var Laya = (window.Laya = (function (t, e) {
  var i = {
    __internals: [],
    __packages: {},
    __classmap: {
      Object: Object,
      Function: Function,
      Array: Array,
      String: String,
    },
    __sysClass: {
      object: "Object",
      array: "Array",
      string: "String",
      dictionary: "Dictionary",
    },
    __propun: { writable: !0, enumerable: !1, configurable: !0 },
    __presubstr: String.prototype.substr,
    __substr: function (t, e) {
      return 1 == arguments.length
        ? i.__presubstr.call(this, t)
        : i.__presubstr.call(this, t, e > 0 ? e : this.length + e);
    },
    __init: function (t) {
      t.forEach(function (t) {
        t.__init$ && t.__init$();
      });
    },
    __isClass: function (t) {
      return t && (t.__isclass || t == Object || t == String || t == Array);
    },
    __newvec: function (t, e) {
      var i = [];
      i.length = t;
      for (var n = 0; n < t; n++) i[n] = e;
      return i;
    },
    __extend: function (t, e) {
      function n() {
        i.un(this, "constructor", t);
      }
      for (var s in e)
        if (e.hasOwnProperty(s)) {
          var r = Object.getOwnPropertyDescriptor(e, s),
            a = r.get,
            o = r.set;
          a || o
            ? a && o
              ? Object.defineProperty(t, s, r)
              : (a && Object.defineProperty(t, s, a),
                o && Object.defineProperty(t, s, o))
            : (t[s] = e[s]);
        }
      (n.prototype = e.prototype),
        (t.prototype = new n()),
        i.un(t.prototype, "__imps", i.__copy({}, e.prototype.__imps));
    },
    __copy: function (t, e) {
      if (!e) return null;
      t = t || {};
      for (var i in e) t[i] = e[i];
      return t;
    },
    __package: function (e, n) {
      if (!i.__packages[e]) {
        i.__packages[e] = !0;
        var s = t,
          r = e.split(".");
        if (r.length > 1)
          for (var a = 0, o = r.length - 1; a < o; a++) {
            var h = s[r[a]];
            s = h || (s[r[a]] = {});
          }
        s[r[r.length - 1]] || (s[r[r.length - 1]] = n || {});
      }
    },
    __hasOwnProperty: function (t, e) {
      function i(t, e) {
        if (Object.hasOwnProperty.call(e.prototype, t)) return !0;
        var n = e.prototype.__super;
        return null == n ? null : i(t, n);
      }
      return (
        (e = e || this), Object.hasOwnProperty.call(e, t) || i(t, e.__class)
      );
    },
    __typeof: function (t, e) {
      if (!t || !e) return !1;
      if (e === String) return "string" == typeof t;
      if (e === Number) return "number" == typeof t;
      if (e.__interface__) e = e.__interface__;
      else if ("string" != typeof e) return t instanceof e;
      return (t.__imps && t.__imps[e]) || t.__class == e;
    },
    __as: function (t, e) {
      return this.__typeof(t, e) ? t : null;
    },
    __int: function (t) {
      return t ? parseInt(t) : 0;
    },
    interface: function (e, n) {
      i.__package(e, {});
      var s = i.__internals,
        r = (s[e] = s[e] || { self: e });
      if (n) {
        var a = n.split(",");
        r.extend = [];
        for (c = 0; c < a.length; c++) {
          var o = a[c];
          (s[o] = s[o] || { self: o }), r.extend.push(s[o]);
        }
      }
      for (var h = t, l = e.split("."), c = 0; c < l.length - 1; c++)
        h = h[l[c]];
      h[l[l.length - 1]] = { __interface__: e };
    },
    class: function (e, n, s, r) {
      if ((s && i.__extend(e, s), n))
        if ((i.__package(n, e), (i.__classmap[n] = e), n.indexOf(".") > 0)) {
          if (0 == n.indexOf("laya.")) {
            var a = n.split(".");
            (r = r || a[a.length - 1]),
              i[r] &&
                console.log(
                  "Warning!,this class[" + r + "] already exist:",
                  i[r]
                ),
              (i[r] = e);
          }
        } else
          "Main" == n
            ? (t.Main = e)
            : (i[n] &&
                console.log(
                  "Error!,this class[" + n + "] already exist:",
                  i[n]
                ),
              (i[n] = e));
      var o = i.un,
        h = e.prototype;
      o(h, "hasOwnProperty", i.__hasOwnProperty),
        o(h, "__class", e),
        o(h, "__super", s),
        o(h, "__className", n),
        o(e, "__super", s),
        o(e, "__className", n),
        o(e, "__isclass", !0),
        o(e, "super", function (t) {
          this.__super.call(t);
        });
    },
    imps: function (t, e) {
      function n(t) {
        var e, r;
        if ((e = i.__internals[t]) && ((s[t] = !0), (r = e.extend)))
          for (var a = 0; a < r.length; a++) n(r[a].self);
      }
      if (!e) return null;
      var s = t.__imps || i.un(t, "__imps", {});
      for (var r in e) n(r);
    },
    superSet: function (t, e, i, n) {
      var s = t.prototype["_$set_" + i];
      s && s.call(e, n);
    },
    superGet: function (t, e, i) {
      var n = t.prototype["_$get_" + i];
      return n ? n.call(e) : null;
    },
    getset: function (t, e, n, s, r) {
      t
        ? (s && (e["_$GET_" + n] = s), r && (e["_$SET_" + n] = r))
        : (s && i.un(e, "_$get_" + n, s), r && i.un(e, "_$set_" + n, r)),
        s && r
          ? Object.defineProperty(e, n, {
              get: s,
              set: r,
              enumerable: !1,
              configurable: !0,
            })
          : (s &&
              Object.defineProperty(e, n, {
                get: s,
                enumerable: !1,
                configurable: !0,
              }),
            r &&
              Object.defineProperty(e, n, {
                set: r,
                enumerable: !1,
                configurable: !0,
              }));
    },
    static: function (t, e) {
      for (var i = 0, n = e.length; i < n; i += 2)
        "length" == e[i]
          ? (t.length = e[i + 1].call(t))
          : (function () {
              var n = e[i],
                s = e[i + 1];
              Object.defineProperty(t, n, {
                get: function () {
                  return delete this[n], (this[n] = s.call(this));
                },
                set: function (t) {
                  delete this[n], (this[n] = t);
                },
                enumerable: !0,
                configurable: !0,
              });
            })();
    },
    un: function (t, e, n) {
      return (
        n || (n = t[e]),
        (i.__propun.value = n),
        Object.defineProperty(t, e, i.__propun),
        n
      );
    },
    uns: function (t, e) {
      e.forEach(function (e) {
        i.un(t, e);
      });
    },
  };
  return (
    (t.console = t.console || { log: function () {} }),
    (t.trace = t.console.log),
    (Error.prototype.throwError = function () {
      throw arguments;
    }),
    Object.defineProperty(Array.prototype, "fixed", { enumerable: !1 }),
    i
  );
})(window, document));
!(function (t, e, i) {
  i.un, i.uns, i.static, i.class, i.getset, i.__newvec;
})(window, document, Laya),
  (function (window, document, Laya) {
    var __un = Laya.un,
      __uns = Laya.uns,
      __static = Laya.static,
      __class = Laya.class,
      __getset = Laya.getset,
      __newvec = Laya.__newvec;
    Laya.interface("laya.runtime.IMarket"),
      Laya.interface("laya.filters.IFilter"),
      Laya.interface("laya.display.ILayout"),
      Laya.interface("laya.resource.IDispose"),
      Laya.interface("laya.runtime.IPlatform"),
      Laya.interface("laya.resource.IDestroy"),
      Laya.interface("laya.runtime.IConchNode"),
      Laya.interface("laya.filters.IFilterAction"),
      Laya.interface("laya.runtime.ICPlatformClass"),
      Laya.interface("laya.resource.ICreateResource"),
      Laya.interface("laya.runtime.IConchRenderObject"),
      Laya.interface("laya.runtime.IPlatformClass", "laya.runtime.IPlatform");
    var RunDriver = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.RunDriver"),
          (t.FILTER_ACTIONS = []),
          (t.pixelRatio = -1),
          (t._charSizeTestDiv = null),
          (t.now = function () {
            return Date.now();
          }),
          (t.getWindow = function () {
            return window;
          }),
          (t.getPixelRatio = function () {
            if (t.pixelRatio < 0) {
              var e = Browser.context,
                i =
                  e.backingStorePixelRatio ||
                  e.webkitBackingStorePixelRatio ||
                  e.mozBackingStorePixelRatio ||
                  e.msBackingStorePixelRatio ||
                  e.oBackingStorePixelRatio ||
                  e.backingStorePixelRatio ||
                  1;
              (t.pixelRatio = (Browser.window.devicePixelRatio || 1) / i) < 1 &&
                (t.pixelRatio = 1);
            }
            return t.pixelRatio;
          }),
          (t.getIncludeStr = function (t) {
            return null;
          }),
          (t.createShaderCondition = function (t) {
            var e = "(function() {return " + t + ";})";
            return Browser.window.eval(e);
          }),
          (t.fontMap = []),
          (t.measureText = function (e, i) {
            var n = t.hanzi.test(e);
            if (n && t.fontMap[i]) return t.fontMap[i];
            var s = Browser.context;
            s.font = i;
            var r = s.measureText(e);
            return n && (t.fontMap[i] = r), r;
          }),
          (t.getWebGLContext = function (t) {}),
          (t.beginFlush = function () {}),
          (t.endFinish = function () {}),
          (t.addToAtlas = null),
          (t.flashFlushImage = function (t) {}),
          (t.drawToCanvas = function (t, e, i, n, s, r) {
            var a = HTMLCanvas.create("2D"),
              o = new RenderContext(i, n, a);
            return RenderSprite.renders[e]._fun(t, o, s, r), a;
          }),
          (t.createParticleTemplate2D = null),
          (t.createGLTextur = null),
          (t.createWebGLContext2D = null),
          (t.changeWebGLSize = function (t, e) {}),
          (t.createRenderSprite = function (t, e) {
            return new RenderSprite(t, e);
          }),
          (t.createFilterAction = function (t) {
            return new ColorFilterAction();
          }),
          (t.createGraphics = function () {
            return new Graphics();
          }),
          (t.clear = function (t) {
            Render._context.ctx.clear();
          }),
          (t.cancelLoadByUrl = function (t) {}),
          (t.clearAtlas = function (t) {}),
          (t.isAtlas = function (t) {
            return !1;
          }),
          (t.addTextureToAtlas = function (t) {}),
          (t.getTexturePixels = function (t, e, i, n, s) {
            return null;
          }),
          (t.skinAniSprite = function () {
            return null;
          }),
          (t.update3DLoop = function () {}),
          __static(t, [
            "hanzi",
            function () {
              return (this.hanzi = new RegExp("^[一-龥]$"));
            },
          ]),
          t
        );
      })(),
      ___Laya =
        (__getset(1, Laya, "alertGlobalError", null, function (t) {
          var e = 0;
          Browser.window.onerror = t
            ? function (t, i, n, s, r) {
                e++ < 5 &&
                  r &&
                  alert(
                    "出错啦，请把此信息截图给研发商\n" + t + "\n" + r.stack || r
                  );
              }
            : null;
        }),
        (Laya.init = function (t, e, i) {
          for (var n = [], s = 2, r = arguments.length; s < r; s++)
            n.push(arguments[s]);
          if (!Laya._isinit) {
            ArrayBuffer.prototype.slice ||
              (ArrayBuffer.prototype.slice = Laya._arrayBufferSlice),
              (Laya._isinit = !0),
              Browser.__init__(),
              Context.__init__(),
              Graphics.__init__(),
              (Laya.timer = new Timer()),
              (Laya.scaleTimer = new Timer()),
              (Laya.loader = new LoaderManager()),
              WeakObject.__init__();
            for (var s = 0, a = n.length; s < a; s++)
              n[s].enable && n[s].enable();
            return (
              Font.__init__(),
              Style.__init__(),
              ResourceManager.__init__(),
              CacheManager.beginCheck(),
              (Laya._currentStage = Laya.stage = new Stage()),
              Laya.stage.conchModel && Laya.stage.conchModel.setRootNode(),
              Laya.getUrlPath(),
              (Laya.render = new Render(0, 0)),
              Laya.stage.size(t, e),
              RenderSprite.__init__(),
              KeyBoardManager.__init__(),
              MouseManager.instance.__init__(Laya.stage, Render.canvas),
              Input.__init__(),
              (SoundManager.autoStopMusic = !0),
              LocalStorage.__init__(),
              Render.canvas
            );
          }
        }),
        (Laya.getUrlPath = function () {
          var t = Browser.window.location,
            e = t.pathname;
          (e = ":" == e.charAt(2) ? e.substring(1) : e),
            (URL.rootPath = URL.basePath =
              URL.getPath(
                "file:" == t.protocol
                  ? e
                  : t.protocol + "//" + t.host + t.pathname
              ));
        }),
        (Laya._arrayBufferSlice = function (t, e) {
          var i = new Uint8Array(this, t, e - t),
            n = new Uint8Array(i.length);
          return n.set(i), n.buffer;
        }),
        (Laya.stage = null),
        (Laya.timer = null),
        (Laya.scaleTimer = null),
        (Laya.loader = null),
        (Laya.version = "1.7.17beta"),
        (Laya.render = null),
        (Laya._currentStage = null),
        (Laya._isinit = !1),
        (Laya.MiniAdpter = {
          init: function () {
            window.navigator &&
              window.navigator.userAgent &&
              window.navigator.userAgent.indexOf("MiniGame") > -1 &&
              console.error(
                "请先引用小游戏适配库laya.wxmini.js,详细教程：https://ldc.layabox.com/doc/?nav=zh-ts-5-0-0"
              );
          },
        }),
        __static(Laya, [
          "conchMarket",
          function () {
            return (this.conchMarket = window.conch ? conchMarket : null);
          },
          "PlatformClass",
          function () {
            return (this.PlatformClass = window.PlatformClass);
          },
        ]),
        Laya),
      Config = (function () {
        function t() {}
        return (
          __class(t, "Config"),
          (t.WebGLTextCacheCount = 500),
          (t.atlasEnable = !1),
          (t.showCanvasMark = !1),
          (t.animationInterval = 50),
          (t.isAntialias = !1),
          (t.isAlpha = !1),
          (t.premultipliedAlpha = !0),
          (t.isStencil = !0),
          (t.preserveDrawingBuffer = !1),
          t
        );
      })(),
      EventDispatcher = (function () {
        function t() {
          this._events = null;
        }
        var e;
        __class(t, "laya.events.EventDispatcher");
        var i = t.prototype;
        return (
          (i.hasListener = function (t) {
            return !!(this._events && this._events[t]);
          }),
          (i.event = function (t, e) {
            if (!this._events || !this._events[t]) return !1;
            var i = this._events[t];
            if (i.run)
              i.once && delete this._events[t],
                null != e ? i.runWith(e) : i.run();
            else {
              for (var n = 0, s = i.length; n < s; n++) {
                var r = i[n];
                r && (null != e ? r.runWith(e) : r.run()),
                  (r && !r.once) || (i.splice(n, 1), n--, s--);
              }
              0 === i.length && this._events && delete this._events[t];
            }
            return !0;
          }),
          (i.on = function (t, e, i, n) {
            return this._createListener(t, e, i, n, !1);
          }),
          (i.once = function (t, e, i, n) {
            return this._createListener(t, e, i, n, !0);
          }),
          (i._createListener = function (t, i, n, s, r, a) {
            void 0 === a && (a = !0), a && this.off(t, i, n, r);
            var o = e.create(i || this, n, s, r);
            this._events || (this._events = {});
            var h = this._events;
            return (
              h[t]
                ? h[t].run
                  ? (h[t] = [h[t], o])
                  : h[t].push(o)
                : (h[t] = o),
              this
            );
          }),
          (i.off = function (t, e, i, n) {
            if ((void 0 === n && (n = !1), !this._events || !this._events[t]))
              return this;
            var s = this._events[t];
            if (null != i)
              if (s.run)
                (e && s.caller !== e) ||
                  s.method !== i ||
                  (n && !s.once) ||
                  (delete this._events[t], s.recover());
              else {
                for (var r = 0, a = 0, o = s.length; a < o; a++) {
                  var h = s[a];
                  !h ||
                    (e && h.caller !== e) ||
                    h.method !== i ||
                    (n && !h.once) ||
                    (r++, (s[a] = null), h.recover());
                }
                r === o && delete this._events[t];
              }
            return this;
          }),
          (i.offAll = function (t) {
            var e = this._events;
            if (!e) return this;
            if (t) this._recoverHandlers(e[t]), delete e[t];
            else {
              for (var i in e) this._recoverHandlers(e[i]);
              this._events = null;
            }
            return this;
          }),
          (i._recoverHandlers = function (t) {
            if (t)
              if (t.run) t.recover();
              else
                for (var e = t.length - 1; e > -1; e--)
                  t[e] && (t[e].recover(), (t[e] = null));
          }),
          (i.isMouseEvent = function (e) {
            return t.MOUSE_EVENTS[e];
          }),
          (t.MOUSE_EVENTS = {
            rightmousedown: !0,
            rightmouseup: !0,
            rightclick: !0,
            mousedown: !0,
            mouseup: !0,
            mousemove: !0,
            mouseover: !0,
            mouseout: !0,
            click: !0,
            doubleclick: !0,
          }),
          (t.__init$ = function () {
            Object.defineProperty(
              laya.events.EventDispatcher.prototype,
              "_events",
              { enumerable: !1, writable: !0 }
            ),
              (e = (function (t) {
                function e(t, i, n, s) {
                  e.__super.call(this, t, i, n, s);
                }
                __class(e, "", Handler);
                return (
                  (e.prototype.recover = function () {
                    this._id > 0 &&
                      ((this._id = 0), e._pool.push(this.clear()));
                  }),
                  (e.create = function (t, i, n, s) {
                    return (
                      void 0 === s && (s = !0),
                      e._pool.length
                        ? e._pool.pop().setTo(t, i, n, s)
                        : new e(t, i, n, s)
                    );
                  }),
                  (e._pool = []),
                  e
                );
              })());
          }),
          t
        );
      })(),
      Handler = (function () {
        function t(t, e, i, n) {
          (this.once = !1),
            (this._id = 0),
            void 0 === n && (n = !1),
            this.setTo(t, e, i, n);
        }
        __class(t, "laya.utils.Handler");
        var e = t.prototype;
        return (
          (e.setTo = function (e, i, n, s) {
            return (
              (this._id = t._gid++),
              (this.caller = e),
              (this.method = i),
              (this.args = n),
              (this.once = s),
              this
            );
          }),
          (e.run = function () {
            if (null == this.method) return null;
            var t = this._id,
              e = this.method.apply(this.caller, this.args);
            return this._id === t && this.once && this.recover(), e;
          }),
          (e.runWith = function (t) {
            if (null == this.method) return null;
            var e = this._id;
            if (null == t) var i = this.method.apply(this.caller, this.args);
            else
              i =
                this.args || t.unshift
                  ? this.args
                    ? this.method.apply(this.caller, this.args.concat(t))
                    : this.method.apply(this.caller, t)
                  : this.method.call(this.caller, t);
            return this._id === e && this.once && this.recover(), i;
          }),
          (e.clear = function () {
            return (
              (this.caller = null),
              (this.method = null),
              (this.args = null),
              this
            );
          }),
          (e.recover = function () {
            this._id > 0 && ((this._id = 0), t._pool.push(this.clear()));
          }),
          (t.create = function (e, i, n, s) {
            return (
              void 0 === s && (s = !0),
              t._pool.length
                ? t._pool.pop().setTo(e, i, n, s)
                : new t(e, i, n, s)
            );
          }),
          (t._pool = []),
          (t._gid = 1),
          t
        );
      })(),
      BitmapFont = (function () {
        function t() {
          (this._texture = null),
            (this._fontCharDic = {}),
            (this._fontWidthMap = {}),
            (this._complete = null),
            (this._path = null),
            (this._maxWidth = 0),
            (this._spaceWidth = 10),
            (this._padding = null),
            (this.fontSize = 12),
            (this.autoScaleSize = !1),
            (this.letterSpacing = 0);
        }
        __class(t, "laya.display.BitmapFont");
        var e = t.prototype;
        return (
          (e.loadFont = function (t, e) {
            (this._path = t),
              (this._complete = e),
              Laya.loader.load(
                [
                  { url: this._path, type: "xml" },
                  { url: this._path.replace(".fnt", ".png"), type: "image" },
                ],
                Handler.create(this, this.onLoaded)
              );
          }),
          (e.onLoaded = function () {
            this.parseFont(
              Loader.getRes(this._path),
              Loader.getRes(this._path.replace(".fnt", ".png"))
            ),
              this._complete &&
                this._complete.runWith(this._texture ? this : null);
          }),
          (e.parseFont = function (t, e) {
            if (null != t && null != e) {
              this._texture = e;
              var i = t.getElementsByTagName("info");
              if (!i[0].getAttributeNode) return this.parseFont2(t, e);
              this.fontSize = parseInt(i[0].getAttributeNode("size").nodeValue);
              var n = i[0].getAttributeNode("padding").nodeValue.split(",");
              this._padding = [
                parseInt(n[0]),
                parseInt(n[1]),
                parseInt(n[2]),
                parseInt(n[3]),
              ];
              var s;
              s = t.getElementsByTagName("char");
              var r = 0;
              for (r = 0; r < s.length; r++) {
                var a = s[r],
                  o = parseInt(a.getAttributeNode("id").nodeValue),
                  h = parseInt(a.getAttributeNode("xoffset").nodeValue) / 1,
                  l = parseInt(a.getAttributeNode("yoffset").nodeValue) / 1,
                  c = parseInt(a.getAttributeNode("xadvance").nodeValue) / 1,
                  u = new Rectangle();
                (u.x = parseInt(a.getAttributeNode("x").nodeValue)),
                  (u.y = parseInt(a.getAttributeNode("y").nodeValue)),
                  (u.width = parseInt(a.getAttributeNode("width").nodeValue)),
                  (u.height = parseInt(a.getAttributeNode("height").nodeValue));
                var _ = Texture.create(e, u.x, u.y, u.width, u.height, h, l);
                (this._maxWidth = Math.max(
                  this._maxWidth,
                  c + this.letterSpacing
                )),
                  (this._fontCharDic[o] = _),
                  (this._fontWidthMap[o] = c);
              }
            }
          }),
          (e.parseFont2 = function (t, e) {
            if (null != t && null != e) {
              this._texture = e;
              var i = t.getElementsByTagName("info");
              this.fontSize = parseInt(i[0].attributes.size.nodeValue);
              var n = i[0].attributes.padding.nodeValue.split(",");
              this._padding = [
                parseInt(n[0]),
                parseInt(n[1]),
                parseInt(n[2]),
                parseInt(n[3]),
              ];
              var s = t.getElementsByTagName("char"),
                r = 0;
              for (r = 0; r < s.length; r++) {
                var a = s[r].attributes,
                  o = parseInt(a.id.nodeValue),
                  h = parseInt(a.xoffset.nodeValue) / 1,
                  l = parseInt(a.yoffset.nodeValue) / 1,
                  c = parseInt(a.xadvance.nodeValue) / 1,
                  u = new Rectangle();
                (u.x = parseInt(a.x.nodeValue)),
                  (u.y = parseInt(a.y.nodeValue)),
                  (u.width = parseInt(a.width.nodeValue)),
                  (u.height = parseInt(a.height.nodeValue));
                var _ = Texture.create(e, u.x, u.y, u.width, u.height, h, l);
                (this._maxWidth = Math.max(
                  this._maxWidth,
                  c + this.letterSpacing
                )),
                  (this._fontCharDic[o] = _),
                  (this._fontWidthMap[o] = c);
              }
            }
          }),
          (e.getCharTexture = function (t) {
            return this._fontCharDic[t.charCodeAt(0)];
          }),
          (e.destroy = function () {
            if (this._texture) {
              for (var t in this._fontCharDic) {
                var e = this._fontCharDic[t];
                e && e.destroy();
              }
              this._texture.destroy(),
                (this._fontCharDic = null),
                (this._fontWidthMap = null),
                (this._texture = null);
            }
          }),
          (e.setSpaceWidth = function (t) {
            this._spaceWidth = t;
          }),
          (e.getCharWidth = function (t) {
            var e = t.charCodeAt(0);
            return this._fontWidthMap[e]
              ? this._fontWidthMap[e] + this.letterSpacing
              : " " == t
              ? this._spaceWidth + this.letterSpacing
              : 0;
          }),
          (e.getTextWidth = function (t) {
            for (var e = 0, i = 0, n = t.length; i < n; i++)
              e += this.getCharWidth(t.charAt(i));
            return e;
          }),
          (e.getMaxWidth = function () {
            return this._maxWidth;
          }),
          (e.getMaxHeight = function () {
            return this.fontSize;
          }),
          (e.drawText = function (t, e, i, n, s, r) {
            var a,
              o = this.getTextWidth(t),
              h = 0;
            "center" === s && (h = (r - o) / 2), "right" === s && (h = r - o);
            for (var l = 0, c = 0, u = t.length; c < u; c++)
              (a = this.getCharTexture(t.charAt(c))) &&
                (e.graphics.drawTexture(a, i + l + h, n),
                (l += this.getCharWidth(t.charAt(c))));
          }),
          t
        );
      })(),
      Style = (function () {
        function t() {
          (this.alpha = 1),
            (this.visible = !0),
            (this.scrollRect = null),
            (this.blendMode = null),
            (this._type = 0),
            (this._tf = t._TF_EMPTY);
        }
        __class(t, "laya.display.css.Style");
        var e = t.prototype;
        return (
          (e.getTransform = function () {
            return this._tf;
          }),
          (e.setTransform = function (e) {
            this._tf = "none" !== e && e ? e : t._TF_EMPTY;
          }),
          (e.setTranslateX = function (e) {
            this._tf === t._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.translateX = e);
          }),
          (e.setTranslateY = function (e) {
            this._tf === t._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.translateY = e);
          }),
          (e.setScaleX = function (e) {
            this._tf === t._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.scaleX = e);
          }),
          (e.setScale = function (e, i) {
            this._tf === t._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.scaleX = e),
              (this._tf.scaleY = i);
          }),
          (e.setScaleY = function (e) {
            this._tf === t._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.scaleY = e);
          }),
          (e.setRotate = function (e) {
            this._tf === t._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.rotate = e);
          }),
          (e.setSkewX = function (e) {
            this._tf === t._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.skewX = e);
          }),
          (e.setSkewY = function (e) {
            this._tf === t._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.skewY = e);
          }),
          (e.destroy = function () {
            this.scrollRect = null;
          }),
          (e.render = function (t, e, i, n) {}),
          (e.getCSSStyle = function () {
            return CSSStyle.EMPTY;
          }),
          (e._enableLayout = function () {
            return !1;
          }),
          __getset(
            0,
            e,
            "scaleX",
            function () {
              return this._tf.scaleX;
            },
            function (t) {
              this.setScaleX(t);
            }
          ),
          __getset(
            0,
            e,
            "transform",
            function () {
              return this.getTransform();
            },
            function (t) {
              this.setTransform(t);
            }
          ),
          __getset(
            0,
            e,
            "translateX",
            function () {
              return this._tf.translateX;
            },
            function (t) {
              this.setTranslateX(t);
            }
          ),
          __getset(
            0,
            e,
            "translateY",
            function () {
              return this._tf.translateY;
            },
            function (t) {
              this.setTranslateY(t);
            }
          ),
          __getset(
            0,
            e,
            "scaleY",
            function () {
              return this._tf.scaleY;
            },
            function (t) {
              this.setScaleY(t);
            }
          ),
          __getset(0, e, "block", function () {
            return 0 != (1 & this._type);
          }),
          __getset(
            0,
            e,
            "skewY",
            function () {
              return this._tf.skewY;
            },
            function (t) {
              this.setSkewY(t);
            }
          ),
          __getset(
            0,
            e,
            "rotate",
            function () {
              return this._tf.rotate;
            },
            function (t) {
              this.setRotate(t);
            }
          ),
          __getset(
            0,
            e,
            "skewX",
            function () {
              return this._tf.skewX;
            },
            function (t) {
              this.setSkewX(t);
            }
          ),
          __getset(0, e, "paddingLeft", function () {
            return 0;
          }),
          __getset(0, e, "paddingTop", function () {
            return 0;
          }),
          __getset(0, e, "absolute", function () {
            return !0;
          }),
          (t.__init__ = function () {
            (t._TF_EMPTY = new TransformInfo()), (t.EMPTY = new t());
          }),
          (t.EMPTY = null),
          (t._TF_EMPTY = null),
          t
        );
      })(),
      Font = (function () {
        function t(e) {
          (this._type = 0),
            (this._weight = 0),
            (this._decoration = null),
            (this._text = null),
            (this.indent = 0),
            (this._color = Color.create(t.defaultColor)),
            (this.family = t.defaultFamily),
            (this.stroke = t._STROKE),
            (this.size = t.defaultSize),
            e && e !== t.EMPTY && e.copyTo(this);
        }
        __class(t, "laya.display.css.Font");
        var e = t.prototype;
        return (
          (e.set = function (t) {
            this._text = null;
            for (var e = t.split(" "), i = 0, n = e.length; i < n; i++) {
              var s = e[i];
              switch (s) {
                case "italic":
                  this.italic = !0;
                  continue;
                case "bold":
                  this.bold = !0;
                  continue;
              }
              s.indexOf("px") > 0 &&
                ((this.size = parseInt(s)), (this.family = e[i + 1]), i++);
            }
          }),
          (e.toString = function () {
            return (
              (this._text = ""),
              this.italic && (this._text += "italic "),
              this.bold && (this._text += "bold "),
              (this._text += this.size + "px " + this.family)
            );
          }),
          (e.copyTo = function (e) {
            (e._type = this._type),
              (e._text = this._text),
              (e._weight = this._weight),
              (e._color = this._color),
              (e.family = this.family),
              (e.stroke =
                this.stroke != t._STROKE ? this.stroke.slice() : t._STROKE),
              (e.indent = this.indent),
              (e.size = this.size);
          }),
          __getset(
            0,
            e,
            "password",
            function () {
              return 0 != (1024 & this._type);
            },
            function (t) {
              t ? (this._type |= 1024) : (this._type &= -1025);
            }
          ),
          __getset(
            0,
            e,
            "color",
            function () {
              return this._color.strColor;
            },
            function (t) {
              this._color = Color.create(t);
            }
          ),
          __getset(
            0,
            e,
            "italic",
            function () {
              return 0 != (512 & this._type);
            },
            function (t) {
              t ? (this._type |= 512) : (this._type &= -513);
            }
          ),
          __getset(
            0,
            e,
            "bold",
            function () {
              return 0 != (2048 & this._type);
            },
            function (t) {
              t ? (this._type |= 2048) : (this._type &= -2049);
            }
          ),
          __getset(
            0,
            e,
            "weight",
            function () {
              return "" + this._weight;
            },
            function (t) {
              var e = 0;
              switch (t) {
                case "normal":
                  break;
                case "bold":
                  (this.bold = !0), (e = 700);
                  break;
                case "bolder":
                  e = 800;
                  break;
                case "lighter":
                  e = 100;
                  break;
                default:
                  e = parseInt(t);
              }
              (this._weight = e), (this._text = null);
            }
          ),
          __getset(
            0,
            e,
            "decoration",
            function () {
              return this._decoration ? this._decoration.value : "none";
            },
            function (t) {
              var e = t.split(" ");
              switch ((this._decoration || (this._decoration = {}), e[0])) {
                case "_":
                  this._decoration.type = "underline";
                  break;
                case "-":
                  this._decoration.type = "line-through";
                  break;
                case "overline":
                  this._decoration.type = "overline";
                  break;
                default:
                  this._decoration.type = e[0];
              }
              e[1] && (this._decoration.color = Color.create(e)),
                (this._decoration.value = t);
            }
          ),
          (t.__init__ = function () {
            t.EMPTY = new t(null);
          }),
          (t.EMPTY = null),
          (t.defaultColor = "#000000"),
          (t.defaultSize = 12),
          (t.defaultFamily = "Arial"),
          (t.defaultFont = "12px Arial"),
          (t._STROKE = [0, "#000000"]),
          (t._ITALIC = 512),
          (t._PASSWORD = 1024),
          (t._BOLD = 2048),
          t
        );
      })(),
      TransformInfo = (function () {
        function t() {
          (this.translateX = 0),
            (this.translateY = 0),
            (this.scaleX = 1),
            (this.scaleY = 1),
            (this.rotate = 0),
            (this.skewX = 0),
            (this.skewY = 0);
        }
        return __class(t, "laya.display.css.TransformInfo"), t;
      })(),
      Graphics = (function () {
        function t() {
          if (
            ((this._one = null),
            (this._cmds = null),
            (this._render = this._renderEmpty),
            Render.isConchNode)
          ) {
            (this._nativeObj = new window._conchGraphics()),
              (this.id = this._nativeObj.conchID);
          }
        }
        __class(t, "laya.display.Graphics");
        var e = t.prototype;
        return (
          (e.destroy = function () {
            this.clear(),
              this._graphicBounds && this._graphicBounds.destroy(),
              (this._graphicBounds = null),
              (this._vectorgraphArray = null),
              this._sp && (this._sp._renderType = 0),
              (this._sp = null);
          }),
          (e.clear = function (e) {
            void 0 === e && (e = !1);
            var i = 0,
              n = 0;
            if (e) {
              var s = this._one;
              if (this._cmds) {
                for (n = this._cmds.length, i = 0; i < n; i++)
                  !(s = this._cmds[i]) ||
                    (s.callee !== Render._context._drawTexture &&
                      s.callee !== Render._context._drawTextureWithTransform) ||
                    ((s[0] = null), t._cache.push(s));
                this._cmds.length = 0;
              } else
                s &&
                  (!s ||
                    (s.callee !== Render._context._drawTexture &&
                      s.callee !== Render._context._drawTextureWithTransform) ||
                    ((s[0] = null), t._cache.push(s)));
            } else this._cmds = null;
            if (
              ((this._one = null),
              (this._render = this._renderEmpty),
              this._sp && (this._sp._renderType &= -514),
              this._repaint(),
              this._vectorgraphArray)
            ) {
              for (i = 0, n = this._vectorgraphArray.length; i < n; i++)
                VectorGraphManager.getInstance().deleteShape(
                  this._vectorgraphArray[i]
                );
              this._vectorgraphArray.length = 0;
            }
          }),
          (e._clearBoundsCache = function () {
            this._graphicBounds && this._graphicBounds.reset();
          }),
          (e._initGraphicBounds = function () {
            this._graphicBounds ||
              ((this._graphicBounds = new GraphicsBounds()),
              (this._graphicBounds._graphics = this));
          }),
          (e._repaint = function () {
            this._clearBoundsCache(), this._sp && this._sp.repaint();
          }),
          (e._isOnlyOne = function () {
            return !this._cmds || 0 === this._cmds.length;
          }),
          (e.getBounds = function (t) {
            return (
              void 0 === t && (t = !1),
              this._initGraphicBounds(),
              this._graphicBounds.getBounds(t)
            );
          }),
          (e.getBoundPoints = function (t) {
            return (
              void 0 === t && (t = !1),
              this._initGraphicBounds(),
              this._graphicBounds.getBoundPoints(t)
            );
          }),
          (e._addCmd = function (t) {
            (this._cmds = this._cmds || []),
              (t.callee = t.shift()),
              this._cmds.push(t);
          }),
          (e.setFilters = function (t) {
            this._saveToCmd(Render._context._setFilters, t);
          }),
          (e.drawTexture = function (e, i, n, s, r, a, o) {
            if (
              (void 0 === i && (i = 0),
              void 0 === n && (n = 0),
              void 0 === s && (s = 0),
              void 0 === r && (r = 0),
              void 0 === o && (o = 1),
              !e || o < 0.01)
            )
              return null;
            s || (s = e.sourceWidth),
              r || (r = e.sourceHeight),
              (o = o < 0 ? 0 : o > 1 ? 1 : o);
            var h =
                !Render.isWebGL &&
                (Browser.onFirefox || Browser.onEdge || Browser.onIE)
                  ? 0.5
                  : 0,
              l = s / e.sourceWidth,
              c = r / e.sourceHeight;
            if (
              ((s = e.width * l),
              (r = e.height * c),
              e.loaded && (s <= 0 || r <= 0))
            )
              return null;
            (i += e.offsetX * l),
              (n += e.offsetY * c),
              this._sp && (this._sp._renderType |= 512);
            var u;
            return (
              (i -= h),
              (n -= h),
              (s += 2 * h),
              (r += 2 * h),
              t._cache.length
                ? (((u = t._cache.pop())[0] = e),
                  (u[1] = i),
                  (u[2] = n),
                  (u[3] = s),
                  (u[4] = r),
                  (u[5] = a),
                  (u[6] = o))
                : (u = [e, i, n, s, r, a, o]),
              (u.callee =
                a || 1 != o
                  ? Render._context._drawTextureWithTransform
                  : Render._context._drawTexture),
              null != this._one || a || 1 != o
                ? this._saveToCmd(u.callee, u)
                : ((this._one = u), (this._render = this._renderOneImg)),
              e.loaded || e.once("loaded", this, this._textureLoaded, [e, u]),
              this._repaint(),
              u
            );
          }),
          (e.cleanByTexture = function (t, e, i, n, s) {
            if ((void 0 === n && (n = 0), void 0 === s && (s = 0), !t))
              return this.clear();
            if (this._one && this._render === this._renderOneImg) {
              n || (n = t.sourceWidth), s || (s = t.sourceHeight);
              var r = n / t.sourceWidth,
                a = s / t.sourceHeight;
              (n = t.width * r),
                (s = t.height * a),
                (e += t.offsetX * r),
                (i += t.offsetY * a),
                (this._one[0] = t),
                (this._one[1] = e),
                (this._one[2] = i),
                (this._one[3] = n),
                (this._one[4] = s);
            } else this.clear(), t && this.drawTexture(t, e, i, n, s);
          }),
          (e.drawTextures = function (t, e) {
            t && this._saveToCmd(Render._context._drawTextures, [t, e]);
          }),
          (e.fillTexture = function (t, e, i, n, s, r, a) {
            if (
              (void 0 === n && (n = 0),
              void 0 === s && (s = 0),
              void 0 === r && (r = "repeat"),
              t)
            ) {
              var o = [t, e, i, n, s, r, a || Point.EMPTY, {}];
              t.loaded || t.once("loaded", this, this._textureLoaded, [t, o]),
                this._saveToCmd(Render._context._fillTexture, o);
            }
          }),
          (e._textureLoaded = function (t, e) {
            (e[3] = e[3] || t.width),
              (e[4] = e[4] || t.height),
              this._repaint();
          }),
          (e.fillCircle = function (t, e, i, n, s, r, a) {
            i.bitmap.enableMerageInAtlas = !1;
            var o = new Float32Array(2 * (a + 1)),
              h = new Float32Array(2 * (a + 1)),
              l = new Uint16Array(3 * a),
              c = (2 * Math.PI) / a,
              u = 0;
            (o[0] = n), (o[1] = s), (h[0] = n / i.width), (h[1] = s / i.height);
            for (var _ = 2, d = 0; d < a; d++) {
              var f = r * Math.cos(u) + n,
                p = r * Math.sin(u) + s;
              (o[_] = f),
                (o[_ + 1] = p),
                (h[_] = f / i.width),
                (h[_ + 1] = p / i.height),
                (u += c),
                (_ += 2);
            }
            for (_ = 0, d = 0; d < a; d++)
              (l[_++] = 0),
                (l[_++] = d + 1),
                (l[_++] = d + 2 >= a + 1 ? 1 : d + 2);
            this.drawTriangles(i, t, e, o, h, l);
          }),
          (e.drawTriangles = function (t, e, i, n, s, r, a, o, h, l) {
            void 0 === o && (o = 1),
              this._saveToCmd(Render._context.drawTriangles, [
                t,
                e,
                i,
                n,
                s,
                r,
                a,
                o,
                h,
                l,
              ]);
          }),
          (e._saveToCmd = function (t, e) {
            return (
              this._sp && (this._sp._renderType |= 512),
              null == this._one
                ? ((this._one = e), (this._render = this._renderOne))
                : (this._sp && (this._sp._renderType &= -2),
                  (this._render = this._renderAll),
                  0 === (this._cmds || (this._cmds = [])).length &&
                    this._cmds.push(this._one),
                  this._cmds.push(e)),
              (e.callee = t),
              this._repaint(),
              e
            );
          }),
          (e.clipRect = function (t, e, i, n) {
            this._saveToCmd(Render._context._clipRect, [t, e, i, n]);
          }),
          (e.fillText = function (t, e, i, n, s, r, a) {
            void 0 === a && (a = 0),
              this._saveToCmd(Render._context._fillText, [
                t,
                e,
                i,
                n || Font.defaultFont,
                s,
                r,
              ]);
          }),
          (e.fillBorderText = function (t, e, i, n, s, r, a, o) {
            this._saveToCmd(Render._context._fillBorderText, [
              t,
              e,
              i,
              n || Font.defaultFont,
              s,
              r,
              a,
              o,
            ]);
          }),
          (e.strokeText = function (t, e, i, n, s, r, a) {
            this._saveToCmd(Render._context._strokeText, [
              t,
              e,
              i,
              n || Font.defaultFont,
              s,
              r,
              a,
            ]);
          }),
          (e.alpha = function (t) {
            (t = t < 0 ? 0 : t > 1 ? 1 : t),
              this._saveToCmd(Render._context._alpha, [t]);
          }),
          (e.setAlpha = function (t) {
            (t = t < 0 ? 0 : t > 1 ? 1 : t),
              this._saveToCmd(Render._context._setAlpha, [t]);
          }),
          (e.transform = function (t, e, i) {
            void 0 === e && (e = 0),
              void 0 === i && (i = 0),
              this._saveToCmd(Render._context._transform, [t, e, i]);
          }),
          (e.rotate = function (t, e, i) {
            void 0 === e && (e = 0),
              void 0 === i && (i = 0),
              this._saveToCmd(Render._context._rotate, [t, e, i]);
          }),
          (e.scale = function (t, e, i, n) {
            void 0 === i && (i = 0),
              void 0 === n && (n = 0),
              this._saveToCmd(Render._context._scale, [t, e, i, n]);
          }),
          (e.translate = function (t, e) {
            this._saveToCmd(Render._context._translate, [t, e]);
          }),
          (e.save = function () {
            this._saveToCmd(Render._context._save, []);
          }),
          (e.restore = function () {
            this._saveToCmd(Render._context._restore, []);
          }),
          (e.replaceText = function (t) {
            this._repaint();
            var e = this._cmds;
            if (e) {
              for (var i = e.length - 1; i > -1; i--)
                if (this._isTextCmd(e[i].callee))
                  return (
                    e[i][0].toUpperCase ? (e[i][0] = t) : e[i][0].setText(t), !0
                  );
            } else if (this._one && this._isTextCmd(this._one.callee))
              return (
                this._one[0].toUpperCase
                  ? (this._one[0] = t)
                  : this._one[0].setText(t),
                !0
              );
            return !1;
          }),
          (e._isTextCmd = function (t) {
            return (
              t === Render._context._fillText ||
              t === Render._context._fillBorderText ||
              t === Render._context._strokeText
            );
          }),
          (e.replaceTextColor = function (t) {
            this._repaint();
            var e = this._cmds;
            if (e)
              for (var i = e.length - 1; i > -1; i--)
                this._isTextCmd(e[i].callee) &&
                  ((e[i][4] = t),
                  e[i][0].toUpperCase || (e[i][0].changed = !0));
            else
              this._one &&
                this._isTextCmd(this._one.callee) &&
                ((this._one[4] = t),
                this._one[0].toUpperCase || (this._one[0].changed = !0));
          }),
          (e.loadImage = function (t, e, i, n, s, r) {
            function a(t) {
              t &&
                (o.drawTexture(t, e, i, n, s), null != r && r.call(o._sp, t));
            }
            var o = this;
            void 0 === e && (e = 0),
              void 0 === i && (i = 0),
              void 0 === n && (n = 0),
              void 0 === s && (s = 0);
            var h = Loader.getRes(t);
            h
              ? a(h)
              : Laya.loader.load(t, Handler.create(null, a), null, "image");
          }),
          (e._renderEmpty = function (t, e, i, n) {}),
          (e._renderAll = function (t, e, i, n) {
            for (var s, r = this._cmds, a = 0, o = r.length; a < o; a++)
              (s = r[a]).callee.call(e, i, n, s);
          }),
          (e._renderOne = function (t, e, i, n) {
            this._one.callee.call(e, i, n, this._one);
          }),
          (e._renderOneImg = function (t, e, i, n) {
            this._one.callee.call(e, i, n, this._one),
              2305 !== t._renderType && (t._renderType |= 1);
          }),
          (e.drawLine = function (t, e, i, n, s, r) {
            void 0 === r && (r = 1);
            var a = 0;
            Render.isWebGL &&
              ((a = VectorGraphManager.getInstance().getId()),
              null == this._vectorgraphArray && (this._vectorgraphArray = []),
              this._vectorgraphArray.push(a));
            var o = r % 2 == 0 ? 0 : 0.5,
              h = [t + o, e + o, i + o, n + o, s, r, a];
            this._saveToCmd(Render._context._drawLine, h);
          }),
          (e.drawLines = function (t, e, i, n, s) {
            void 0 === s && (s = 1);
            var r = 0;
            if (i && !(i.length < 4)) {
              Render.isWebGL &&
                ((r = VectorGraphManager.getInstance().getId()),
                null == this._vectorgraphArray && (this._vectorgraphArray = []),
                this._vectorgraphArray.push(r));
              var a = s % 2 == 0 ? 0 : 0.5,
                o = [t + a, e + a, i, n, s, r];
              this._saveToCmd(Render._context._drawLines, o);
            }
          }),
          (e.drawCurves = function (t, e, i, n, s) {
            void 0 === s && (s = 1);
            var r = [t, e, i, n, s];
            this._saveToCmd(Render._context._drawCurves, r);
          }),
          (e.drawRect = function (t, e, i, n, s, r, a) {
            void 0 === a && (a = 1);
            var o = r ? a / 2 : 0,
              h = r ? a : 0,
              l = [t + o, e + o, i - h, n - h, s, r, a];
            this._saveToCmd(Render._context._drawRect, l);
          }),
          (e.drawCircle = function (t, e, i, n, s, r) {
            void 0 === r && (r = 1);
            var a = s ? r / 2 : 0,
              o = 0;
            Render.isWebGL &&
              ((o = VectorGraphManager.getInstance().getId()),
              null == this._vectorgraphArray && (this._vectorgraphArray = []),
              this._vectorgraphArray.push(o));
            var h = [t, e, i - a, n, s, r, o];
            this._saveToCmd(Render._context._drawCircle, h);
          }),
          (e.drawPie = function (t, e, i, n, s, r, a, o) {
            void 0 === o && (o = 1);
            var h = a ? o / 2 : 0,
              l = a ? o : 0,
              c = 0;
            Render.isWebGL &&
              ((c = VectorGraphManager.getInstance().getId()),
              null == this._vectorgraphArray && (this._vectorgraphArray = []),
              this._vectorgraphArray.push(c));
            var u = [t + h, e + h, i - l, n, s, r, a, o, c];
            (u[3] = Utils.toRadian(n)),
              (u[4] = Utils.toRadian(s)),
              this._saveToCmd(Render._context._drawPie, u);
          }),
          (e.drawPoly = function (t, e, i, n, s, r) {
            void 0 === r && (r = 1);
            var a = 0,
              o = !1;
            Render.isWebGL &&
              ((a = VectorGraphManager.getInstance().getId()),
              null == this._vectorgraphArray && (this._vectorgraphArray = []),
              this._vectorgraphArray.push(a),
              (o = !(i.length > 6)));
            var h = s ? (r % 2 == 0 ? 0 : 0.5) : 0,
              l = [t + h, e + h, i, n, s, r, a, o];
            this._saveToCmd(Render._context._drawPoly, l);
          }),
          (e.drawPath = function (t, e, i, n, s) {
            var r = [t, e, i, n, s];
            this._saveToCmd(Render._context._drawPath, r);
          }),
          __getset(
            0,
            e,
            "cmds",
            function () {
              return this._cmds;
            },
            function (t) {
              this._sp && (this._sp._renderType |= 512),
                (this._cmds = t),
                (this._render = this._renderAll),
                this._repaint();
            }
          ),
          (t.__init__ = function () {
            if (Render.isConchNode) {
              for (
                var t = laya.display.Graphics.prototype,
                  e = Browser.window.ConchGraphics.prototype,
                  i = [
                    "clear",
                    "destroy",
                    "alpha",
                    "rotate",
                    "transform",
                    "scale",
                    "translate",
                    "save",
                    "restore",
                    "clipRect",
                    "blendMode",
                    "fillText",
                    "fillBorderText",
                    "_fands",
                    "drawRect",
                    "drawCircle",
                    "drawPie",
                    "drawPoly",
                    "drawPath",
                    "drawImageM",
                    "drawLine",
                    "drawLines",
                    "_drawPs",
                    "drawCurves",
                    "replaceText",
                    "replaceTextColor",
                    "_fillImage",
                    "fillTexture",
                    "setSkinMesh",
                    "drawParticle",
                    "drawImageS",
                  ],
                  n = 0,
                  s = i.length;
                n <= s;
                n++
              ) {
                var r = i[n];
                t[r] = e[r];
              }
              (t._saveToCmd = null),
                e.drawImageS &&
                  (t.drawTextures = function (t, e) {
                    if (t && t.loaded && t.bitmap && t.source) {
                      var i = t.uv,
                        n = t.bitmap.width,
                        s = t.bitmap.height;
                      this.drawImageS(
                        t.bitmap.source,
                        i[0] * n,
                        i[1] * s,
                        (i[2] - i[0]) * n,
                        (i[5] - i[3]) * s,
                        t.offsetX,
                        t.offsetY,
                        t.width,
                        t.height,
                        e
                      );
                    }
                  }),
                (t.drawTexture = function (t, e, i, n, s, r, a) {
                  if (
                    (void 0 === e && (e = 0),
                    void 0 === i && (i = 0),
                    void 0 === n && (n = 0),
                    void 0 === s && (s = 0),
                    void 0 === a && (a = 1),
                    t)
                  )
                    if (t.loaded) {
                      if (
                        t.loaded &&
                        t.bitmap &&
                        t.source &&
                        (n || (n = t.sourceWidth),
                        s || (s = t.sourceHeight),
                        (a = a < 0 ? 0 : a > 1 ? 1 : a),
                        (n = n - t.sourceWidth + t.width),
                        (s = s - t.sourceHeight + t.height),
                        !(n <= 0 || s <= 0))
                      ) {
                        (e += t.offsetX), (i += t.offsetY);
                        var o = t.uv,
                          h = t.bitmap.width,
                          l = t.bitmap.height;
                        this.drawImageM(
                          t.bitmap.source,
                          o[0] * h,
                          o[1] * l,
                          (o[2] - o[0]) * h,
                          (o[5] - o[3]) * l,
                          e,
                          i,
                          n,
                          s,
                          r,
                          a
                        ),
                          this._repaint();
                      }
                    } else
                      t.once("loaded", this, function () {
                        this.drawTexture(t, e, i, n, s, r);
                      });
                }),
                (t.fillTexture = function (t, e, i, n, s, r, a) {
                  if (
                    (void 0 === n && (n = 0),
                    void 0 === s && (s = 0),
                    void 0 === r && (r = "repeat"),
                    t && t.loaded)
                  ) {
                    var o,
                      h = Render._context.ctx,
                      l = t.bitmap.width,
                      c = t.bitmap.height,
                      u = t.uv;
                    o =
                      t.uv != Texture.DEF_UV
                        ? h.createPattern(
                            t.bitmap.source,
                            r,
                            u[0] * l,
                            u[1] * c,
                            (u[2] - u[0]) * l,
                            (u[5] - u[3]) * c
                          )
                        : h.createPattern(t.bitmap.source, r);
                    var _ = 0,
                      d = 0;
                    a &&
                      ((e += a.x % t.width),
                      (i += a.y % t.height),
                      (_ -= a.x % t.width),
                      (d -= a.y % t.height)),
                      this._fillImage(o, e, i, _, d, n, s);
                  }
                });
            }
          }),
          (t._cache = []),
          t
        );
      })(),
      GraphicsBounds = (function () {
        function t() {
          this._cacheBoundsType = !1;
        }
        __class(t, "laya.display.GraphicsBounds");
        var e = t.prototype;
        return (
          (e.destroy = function () {
            (this._graphics = null),
              (this._temp = null),
              (this._rstBoundPoints = null),
              (this._bounds = null);
          }),
          (e.reset = function () {
            this._temp && (this._temp.length = 0);
          }),
          (e.getBounds = function (t) {
            return (
              void 0 === t && (t = !1),
              (!this._bounds ||
                !this._temp ||
                this._temp.length < 1 ||
                t != this._cacheBoundsType) &&
                (this._bounds = Rectangle._getWrapRec(
                  this.getBoundPoints(t),
                  this._bounds
                )),
              (this._cacheBoundsType = t),
              this._bounds
            );
          }),
          (e.getBoundPoints = function (t) {
            return (
              void 0 === t && (t = !1),
              (!this._temp ||
                this._temp.length < 1 ||
                t != this._cacheBoundsType) &&
                (this._temp = this._getCmdPoints(t)),
              (this._cacheBoundsType = t),
              (this._rstBoundPoints = Utils.copyArray(
                this._rstBoundPoints,
                this._temp
              ))
            );
          }),
          (e._getCmdPoints = function (e) {
            void 0 === e && (e = !1);
            var i,
              n = Render._context,
              s = this._graphics.cmds;
            if (
              ((i = this._temp || (this._temp = [])),
              (i.length = 0),
              s ||
                null == this._graphics._one ||
                ((t._tempCmds.length = 0),
                t._tempCmds.push(this._graphics._one),
                (s = t._tempCmds)),
              !s)
            )
              return i;
            var r;
            (r = t._tempMatrixArrays).length = 0;
            var a = t._initMatrix;
            a.identity();
            for (
              var o,
                h,
                l = t._tempMatrix,
                c = NaN,
                u = NaN,
                _ = NaN,
                d = NaN,
                f = NaN,
                p = NaN,
                g = 0,
                m = s.length;
              g < m;
              g++
            )
              if ((o = s[g]).callee)
                switch (o.callee) {
                  case n._save:
                  case 7:
                    r.push(a), (a = a.clone());
                    break;
                  case n._restore:
                  case 8:
                    a = r.pop();
                    break;
                  case n._scale:
                  case 5:
                    l.identity(),
                      l.translate(-o[2], -o[3]),
                      l.scale(o[0], o[1]),
                      l.translate(o[2], o[3]),
                      this._switchMatrix(a, l);
                    break;
                  case n._rotate:
                  case 3:
                    l.identity(),
                      l.translate(-o[1], -o[2]),
                      l.rotate(o[0]),
                      l.translate(o[1], o[2]),
                      this._switchMatrix(a, l);
                    break;
                  case n._translate:
                  case 6:
                    l.identity(),
                      l.translate(o[0], o[1]),
                      this._switchMatrix(a, l);
                    break;
                  case n._transform:
                  case 4:
                    l.identity(),
                      l.translate(-o[1], -o[2]),
                      l.concat(o[0]),
                      l.translate(o[1], o[2]),
                      this._switchMatrix(a, l);
                    break;
                  case 16:
                  case 24:
                    t._addPointArrToRst(
                      i,
                      Rectangle._getBoundPointS(o[0], o[1], o[2], o[3]),
                      a
                    );
                    break;
                  case 17:
                    a.copyTo(l),
                      l.concat(o[4]),
                      t._addPointArrToRst(
                        i,
                        Rectangle._getBoundPointS(o[0], o[1], o[2], o[3]),
                        l
                      );
                    break;
                  case n._drawTexture:
                    (h = o[0]),
                      e
                        ? o[3] && o[4]
                          ? t._addPointArrToRst(
                              i,
                              Rectangle._getBoundPointS(o[1], o[2], o[3], o[4]),
                              a
                            )
                          : ((h = o[0]),
                            t._addPointArrToRst(
                              i,
                              Rectangle._getBoundPointS(
                                o[1],
                                o[2],
                                h.width,
                                h.height
                              ),
                              a
                            ))
                        : ((c = (o[3] || h.sourceWidth) / h.width),
                          (u = (o[4] || h.sourceHeight) / h.height),
                          (_ = c * h.sourceWidth),
                          (d = u * h.sourceHeight),
                          (f = h.offsetX > 0 ? h.offsetX : 0),
                          (p = h.offsetY > 0 ? h.offsetY : 0),
                          (f *= c),
                          (p *= u),
                          t._addPointArrToRst(
                            i,
                            Rectangle._getBoundPointS(o[1] - f, o[2] - p, _, d),
                            a
                          ));
                    break;
                  case n._fillTexture:
                    o[3] && o[4]
                      ? t._addPointArrToRst(
                          i,
                          Rectangle._getBoundPointS(o[1], o[2], o[3], o[4]),
                          a
                        )
                      : ((h = o[0]),
                        t._addPointArrToRst(
                          i,
                          Rectangle._getBoundPointS(
                            o[1],
                            o[2],
                            h.width,
                            h.height
                          ),
                          a
                        ));
                    break;
                  case n._drawTextureWithTransform:
                    var v;
                    o[5] ? (a.copyTo(l), l.concat(o[5]), (v = l)) : (v = a),
                      e
                        ? o[3] && o[4]
                          ? t._addPointArrToRst(
                              i,
                              Rectangle._getBoundPointS(o[1], o[2], o[3], o[4]),
                              v
                            )
                          : ((h = o[0]),
                            t._addPointArrToRst(
                              i,
                              Rectangle._getBoundPointS(
                                o[1],
                                o[2],
                                h.width,
                                h.height
                              ),
                              v
                            ))
                        : ((h = o[0]),
                          (c = (o[3] || h.sourceWidth) / h.width),
                          (u = (o[4] || h.sourceHeight) / h.height),
                          (_ = c * h.sourceWidth),
                          (d = u * h.sourceHeight),
                          (f = h.offsetX > 0 ? h.offsetX : 0),
                          (p = h.offsetY > 0 ? h.offsetY : 0),
                          (f *= c),
                          (p *= u),
                          t._addPointArrToRst(
                            i,
                            Rectangle._getBoundPointS(o[1] - f, o[2] - p, _, d),
                            v
                          ));
                    break;
                  case n._drawRect:
                  case 13:
                    t._addPointArrToRst(
                      i,
                      Rectangle._getBoundPointS(o[0], o[1], o[2], o[3]),
                      a
                    );
                    break;
                  case n._drawCircle:
                  case n._fillCircle:
                  case 14:
                    t._addPointArrToRst(
                      i,
                      Rectangle._getBoundPointS(
                        o[0] - o[2],
                        o[1] - o[2],
                        o[2] + o[2],
                        o[2] + o[2]
                      ),
                      a
                    );
                    break;
                  case n._drawLine:
                  case 20:
                    t._tempPoints.length = 0;
                    var y = NaN;
                    (y = 0.5 * o[5]),
                      o[0] == o[2]
                        ? t._tempPoints.push(
                            o[0] + y,
                            o[1],
                            o[2] + y,
                            o[3],
                            o[0] - y,
                            o[1],
                            o[2] - y,
                            o[3]
                          )
                        : o[1] == o[3]
                        ? t._tempPoints.push(
                            o[0],
                            o[1] + y,
                            o[2],
                            o[3] + y,
                            o[0],
                            o[1] - y,
                            o[2],
                            o[3] - y
                          )
                        : t._tempPoints.push(o[0], o[1], o[2], o[3]),
                      t._addPointArrToRst(i, t._tempPoints, a);
                    break;
                  case n._drawCurves:
                  case 22:
                    t._addPointArrToRst(
                      i,
                      Bezier.I.getBezierPoints(o[2]),
                      a,
                      o[0],
                      o[1]
                    );
                    break;
                  case n._drawPoly:
                  case n._drawLines:
                  case 18:
                    t._addPointArrToRst(i, o[2], a, o[0], o[1]);
                    break;
                  case n._drawPath:
                  case 19:
                    t._addPointArrToRst(
                      i,
                      this._getPathPoints(o[2]),
                      a,
                      o[0],
                      o[1]
                    );
                    break;
                  case n._drawPie:
                  case 15:
                    t._addPointArrToRst(
                      i,
                      this._getPiePoints(o[0], o[1], o[2], o[3], o[4]),
                      a
                    );
                }
            return (
              i.length > 200
                ? (i = Utils.copyArray(
                    i,
                    Rectangle._getWrapRec(i)._getBoundPoints()
                  ))
                : i.length > 8 && (i = GrahamScan.scanPList(i)),
              i
            );
          }),
          (e._switchMatrix = function (t, e) {
            e.concat(t), e.copyTo(t);
          }),
          (e._getPiePoints = function (e, i, n, s, r) {
            var a = t._tempPoints;
            (t._tempPoints.length = 0), a.push(e, i);
            var o = ((r - s) % (2 * Math.PI)) / 10,
              h = NaN,
              l = s;
            for (h = 0; h <= 10; h++)
              a.push(e + n * Math.cos(l), i + n * Math.sin(l)), (l += o);
            return a;
          }),
          (e._getPathPoints = function (e) {
            var i = 0,
              n = 0,
              s = t._tempPoints;
            (s.length = 0), (n = e.length);
            var r;
            for (i = 0; i < n; i++)
              (r = e[i]).length > 1 &&
                (s.push(r[1], r[2]), r.length > 3 && s.push(r[3], r[4]));
            return s;
          }),
          (t._addPointArrToRst = function (e, i, n, s, r) {
            void 0 === s && (s = 0), void 0 === r && (r = 0);
            var a = 0,
              o = 0;
            for (o = i.length, a = 0; a < o; a += 2)
              t._addPointToRst(e, i[a] + s, i[a + 1] + r, n);
          }),
          (t._addPointToRst = function (t, e, i, n) {
            var s = Point.TEMP;
            s.setTo(e || 0, i || 0), n.transformPoint(s), t.push(s.x, s.y);
          }),
          (t._tempPoints = []),
          (t._tempMatrixArrays = []),
          (t._tempCmds = []),
          __static(t, [
            "_tempMatrix",
            function () {
              return (this._tempMatrix = new Matrix());
            },
            "_initMatrix",
            function () {
              return (this._initMatrix = new Matrix());
            },
          ]),
          t
        );
      })(),
      Event = (function () {
        function t() {}
        __class(t, "laya.events.Event");
        var e = t.prototype;
        return (
          (e.setTo = function (t, e, i) {
            return (
              (this.type = t), (this.currentTarget = e), (this.target = i), this
            );
          }),
          (e.stopPropagation = function () {
            this._stoped = !0;
          }),
          __getset(0, e, "stageY", function () {
            return Laya.stage.mouseY;
          }),
          __getset(0, e, "charCode", function () {
            return this.nativeEvent.charCode;
          }),
          __getset(0, e, "touches", function () {
            var t = this.nativeEvent.touches;
            if (t)
              for (var e = Laya.stage, i = 0, n = t.length; i < n; i++) {
                var s = t[i],
                  r = Point.TEMP;
                r.setTo(s.clientX, s.clientY),
                  e._canvasTransform.invertTransformPoint(r),
                  e.transform.invertTransformPoint(r),
                  (s.stageX = r.x),
                  (s.stageY = r.y);
              }
            return t;
          }),
          __getset(0, e, "keyLocation", function () {
            return this.nativeEvent.keyLocation;
          }),
          __getset(0, e, "ctrlKey", function () {
            return this.nativeEvent.ctrlKey;
          }),
          __getset(0, e, "altKey", function () {
            return this.nativeEvent.altKey;
          }),
          __getset(0, e, "shiftKey", function () {
            return this.nativeEvent.shiftKey;
          }),
          __getset(0, e, "stageX", function () {
            return Laya.stage.mouseX;
          }),
          (t.EMPTY = new t()),
          (t.MOUSE_DOWN = "mousedown"),
          (t.MOUSE_UP = "mouseup"),
          (t.CLICK = "click"),
          (t.RIGHT_MOUSE_DOWN = "rightmousedown"),
          (t.RIGHT_MOUSE_UP = "rightmouseup"),
          (t.RIGHT_CLICK = "rightclick"),
          (t.MOUSE_MOVE = "mousemove"),
          (t.MOUSE_OVER = "mouseover"),
          (t.MOUSE_OUT = "mouseout"),
          (t.MOUSE_WHEEL = "mousewheel"),
          (t.ROLL_OVER = "mouseover"),
          (t.ROLL_OUT = "mouseout"),
          (t.DOUBLE_CLICK = "doubleclick"),
          (t.CHANGE = "change"),
          (t.CHANGED = "changed"),
          (t.RESIZE = "resize"),
          (t.ADDED = "added"),
          (t.REMOVED = "removed"),
          (t.DISPLAY = "display"),
          (t.UNDISPLAY = "undisplay"),
          (t.ERROR = "error"),
          (t.COMPLETE = "complete"),
          (t.LOADED = "loaded"),
          (t.PROGRESS = "progress"),
          (t.INPUT = "input"),
          (t.RENDER = "render"),
          (t.OPEN = "open"),
          (t.MESSAGE = "message"),
          (t.CLOSE = "close"),
          (t.KEY_DOWN = "keydown"),
          (t.KEY_PRESS = "keypress"),
          (t.KEY_UP = "keyup"),
          (t.FRAME = "enterframe"),
          (t.DRAG_START = "dragstart"),
          (t.DRAG_MOVE = "dragmove"),
          (t.DRAG_END = "dragend"),
          (t.ENTER = "enter"),
          (t.SELECT = "select"),
          (t.BLUR = "blur"),
          (t.FOCUS = "focus"),
          (t.VISIBILITY_CHANGE = "visibilitychange"),
          (t.FOCUS_CHANGE = "focuschange"),
          (t.PLAYED = "played"),
          (t.PAUSED = "paused"),
          (t.STOPPED = "stopped"),
          (t.START = "start"),
          (t.END = "end"),
          (t.ENABLE_CHANGED = "enablechanged"),
          (t.ACTIVE_IN_HIERARCHY_CHANGED = "activeinhierarchychanged"),
          (t.COMPONENT_ADDED = "componentadded"),
          (t.COMPONENT_REMOVED = "componentremoved"),
          (t.LAYER_CHANGED = "layerchanged"),
          (t.HIERARCHY_LOADED = "hierarchyloaded"),
          (t.RECOVERED = "recovered"),
          (t.RELEASED = "released"),
          (t.LINK = "link"),
          (t.LABEL = "label"),
          (t.FULL_SCREEN_CHANGE = "fullscreenchange"),
          (t.DEVICE_LOST = "devicelost"),
          (t.MESH_CHANGED = "meshchanged"),
          (t.MATERIAL_CHANGED = "materialchanged"),
          (t.WORLDMATRIX_NEEDCHANGE = "worldmatrixneedchanged"),
          (t.ANIMATION_CHANGED = "animationchanged"),
          (t.TRIGGER_ENTER = "triggerenter"),
          (t.TRIGGER_STAY = "triggerstay"),
          (t.TRIGGER_EXIT = "triggerexit"),
          (t.TRAIL_FILTER_CHANGE = "trailfilterchange"),
          (t.DOMINO_FILTER_CHANGE = "dominofilterchange"),
          t
        );
      })(),
      Keyboard = (function () {
        function t() {}
        return (
          __class(t, "laya.events.Keyboard"),
          (t.NUMBER_0 = 48),
          (t.NUMBER_1 = 49),
          (t.NUMBER_2 = 50),
          (t.NUMBER_3 = 51),
          (t.NUMBER_4 = 52),
          (t.NUMBER_5 = 53),
          (t.NUMBER_6 = 54),
          (t.NUMBER_7 = 55),
          (t.NUMBER_8 = 56),
          (t.NUMBER_9 = 57),
          (t.A = 65),
          (t.B = 66),
          (t.C = 67),
          (t.D = 68),
          (t.E = 69),
          (t.F = 70),
          (t.G = 71),
          (t.H = 72),
          (t.I = 73),
          (t.J = 74),
          (t.K = 75),
          (t.L = 76),
          (t.M = 77),
          (t.N = 78),
          (t.O = 79),
          (t.P = 80),
          (t.Q = 81),
          (t.R = 82),
          (t.S = 83),
          (t.T = 84),
          (t.U = 85),
          (t.V = 86),
          (t.W = 87),
          (t.X = 88),
          (t.Y = 89),
          (t.Z = 90),
          (t.F1 = 112),
          (t.F2 = 113),
          (t.F3 = 114),
          (t.F4 = 115),
          (t.F5 = 116),
          (t.F6 = 117),
          (t.F7 = 118),
          (t.F8 = 119),
          (t.F9 = 120),
          (t.F10 = 121),
          (t.F11 = 122),
          (t.F12 = 123),
          (t.F13 = 124),
          (t.F14 = 125),
          (t.F15 = 126),
          (t.NUMPAD = 21),
          (t.NUMPAD_0 = 96),
          (t.NUMPAD_1 = 97),
          (t.NUMPAD_2 = 98),
          (t.NUMPAD_3 = 99),
          (t.NUMPAD_4 = 100),
          (t.NUMPAD_5 = 101),
          (t.NUMPAD_6 = 102),
          (t.NUMPAD_7 = 103),
          (t.NUMPAD_8 = 104),
          (t.NUMPAD_9 = 105),
          (t.NUMPAD_ADD = 107),
          (t.NUMPAD_DECIMAL = 110),
          (t.NUMPAD_DIVIDE = 111),
          (t.NUMPAD_ENTER = 108),
          (t.NUMPAD_MULTIPLY = 106),
          (t.NUMPAD_SUBTRACT = 109),
          (t.SEMICOLON = 186),
          (t.EQUAL = 187),
          (t.COMMA = 188),
          (t.MINUS = 189),
          (t.PERIOD = 190),
          (t.SLASH = 191),
          (t.BACKQUOTE = 192),
          (t.LEFTBRACKET = 219),
          (t.BACKSLASH = 220),
          (t.RIGHTBRACKET = 221),
          (t.QUOTE = 222),
          (t.ALTERNATE = 18),
          (t.BACKSPACE = 8),
          (t.CAPS_LOCK = 20),
          (t.COMMAND = 15),
          (t.CONTROL = 17),
          (t.DELETE = 46),
          (t.ENTER = 13),
          (t.ESCAPE = 27),
          (t.PAGE_UP = 33),
          (t.PAGE_DOWN = 34),
          (t.END = 35),
          (t.HOME = 36),
          (t.LEFT = 37),
          (t.UP = 38),
          (t.RIGHT = 39),
          (t.DOWN = 40),
          (t.SHIFT = 16),
          (t.SPACE = 32),
          (t.TAB = 9),
          (t.INSERT = 45),
          t
        );
      })(),
      KeyBoardManager = (function () {
        function t() {}
        return (
          __class(t, "laya.events.KeyBoardManager"),
          (t.__init__ = function () {
            t._addEvent("keydown"),
              t._addEvent("keypress"),
              t._addEvent("keyup");
          }),
          (t._addEvent = function (t) {
            Browser.document.addEventListener(
              t,
              function (e) {
                laya.events.KeyBoardManager._dispatch(e, t);
              },
              !0
            );
          }),
          (t._dispatch = function (e, i) {
            if (t.enabled) {
              (t._event._stoped = !1),
                (t._event.nativeEvent = e),
                (t._event.keyCode = e.keyCode || e.which || e.charCode),
                "keydown" === i
                  ? (t._pressKeys[t._event.keyCode] = !0)
                  : "keyup" === i && (t._pressKeys[t._event.keyCode] = null);
              for (
                var n =
                    Laya.stage.focus &&
                    null != Laya.stage.focus.event &&
                    Laya.stage.focus.displayedInStage
                      ? Laya.stage.focus
                      : Laya.stage,
                  s = n;
                s;

              )
                s.event(i, t._event.setTo(i, s, n)), (s = s.parent);
            }
          }),
          (t.hasKeyDown = function (e) {
            return t._pressKeys[e];
          }),
          (t._pressKeys = {}),
          (t.enabled = !0),
          __static(t, [
            "_event",
            function () {
              return (this._event = new Event());
            },
          ]),
          t
        );
      })(),
      KeyLocation = (function () {
        function t() {}
        return (
          __class(t, "laya.events.KeyLocation"),
          (t.STANDARD = 0),
          (t.LEFT = 1),
          (t.RIGHT = 2),
          (t.NUM_PAD = 3),
          t
        );
      })(),
      MouseManager = (function () {
        function t() {
          (this.mouseX = 0),
            (this.mouseY = 0),
            (this.disableMouseEvent = !1),
            (this.mouseDownTime = 0),
            (this.mouseMoveAccuracy = 2),
            (this._stage = null),
            (this._target = null),
            (this._lastMoveTimer = 0),
            (this._isLeftMouse = !1),
            (this._eventList = []),
            (this._touchIDs = {}),
            (this._id = 1),
            (this._tTouchID = 0),
            (this._event = new Event()),
            (this._matrix = new Matrix()),
            (this._point = new Point()),
            (this._rect = new Rectangle()),
            (this._prePoint = new Point()),
            (this._curTouchID = NaN);
        }
        __class(t, "laya.events.MouseManager");
        var e = t.prototype;
        return (
          (e.__init__ = function (e, i) {
            var n = this;
            this._stage = e;
            var s = this,
              r = this._eventList;
            (i.oncontextmenu = function (e) {
              if (t.enabled) return !1;
            }),
              i.addEventListener("mousedown", function (e) {
                t.enabled &&
                  (Browser.onIE || e.preventDefault(),
                  r.push(e),
                  (s.mouseDownTime = Browser.now()));
              }),
              i.addEventListener(
                "mouseup",
                function (e) {
                  t.enabled &&
                    (e.preventDefault(),
                    r.push(e),
                    (s.mouseDownTime = -Browser.now()));
                },
                !0
              ),
              i.addEventListener(
                "mousemove",
                function (e) {
                  if (t.enabled) {
                    e.preventDefault();
                    var i = Browser.now();
                    if (i - s._lastMoveTimer < 10) return;
                    (s._lastMoveTimer = i), r.push(e);
                  }
                },
                !0
              ),
              i.addEventListener("mouseout", function (e) {
                t.enabled && r.push(e);
              }),
              i.addEventListener("mouseover", function (e) {
                t.enabled && r.push(e);
              }),
              i.addEventListener("touchstart", function (e) {
                t.enabled &&
                  (r.push(e),
                  t._isFirstTouch || Input.isInputting || e.preventDefault(),
                  (s.mouseDownTime = Browser.now()));
              }),
              i.addEventListener(
                "touchend",
                function (e) {
                  t.enabled
                    ? (t._isFirstTouch ||
                        Input.isInputting ||
                        e.preventDefault(),
                      (t._isFirstTouch = !1),
                      r.push(e),
                      (s.mouseDownTime = -Browser.now()))
                    : (n._curTouchID = NaN);
                },
                !0
              ),
              i.addEventListener(
                "touchmove",
                function (e) {
                  t.enabled && (e.preventDefault(), r.push(e));
                },
                !0
              ),
              i.addEventListener(
                "touchcancel",
                function (e) {
                  t.enabled
                    ? (e.preventDefault(), r.push(e))
                    : (n._curTouchID = NaN);
                },
                !0
              ),
              i.addEventListener("mousewheel", function (e) {
                t.enabled && r.push(e);
              }),
              i.addEventListener("DOMMouseScroll", function (e) {
                t.enabled && r.push(e);
              });
          }),
          (e.initEvent = function (t, e) {
            (this._event._stoped = !1),
              (this._event.nativeEvent = e || t),
              (this._target = null),
              this._point.setTo(t.pageX || t.clientX, t.pageY || t.clientY),
              this._stage._canvasTransform.invertTransformPoint(this._point),
              (this.mouseX = this._point.x),
              (this.mouseY = this._point.y),
              (this._event.touchId = t.identifier || 0),
              (this._tTouchID = this._event.touchId);
            var i;
            ((i = TouchManager.I._event)._stoped = !1),
              (i.nativeEvent = this._event.nativeEvent),
              (i.touchId = this._event.touchId);
          }),
          (e.checkMouseWheel = function (t) {
            this._event.delta = t.wheelDelta ? 0.025 * t.wheelDelta : -t.detail;
            for (
              var e = TouchManager.I.getLastOvers(), i = 0, n = e.length;
              i < n;
              i++
            ) {
              var s = e[i];
              s.event(
                "mousewheel",
                this._event.setTo("mousewheel", s, this._target)
              );
            }
          }),
          (e.onMouseMove = function (t) {
            TouchManager.I.onMouseMove(t, this._tTouchID);
          }),
          (e.onMouseDown = function (t) {
            if (
              Input.isInputting &&
              Laya.stage.focus &&
              Laya.stage.focus.focus &&
              !Laya.stage.focus.contains(this._target)
            ) {
              var e = Laya.stage.focus._tf || Laya.stage.focus,
                i = t._tf || t;
              i instanceof laya.display.Input && i.multiline == e.multiline
                ? e._focusOut()
                : (e.focus = !1);
            }
            TouchManager.I.onMouseDown(t, this._tTouchID, this._isLeftMouse);
          }),
          (e.onMouseUp = function (t) {
            TouchManager.I.onMouseUp(t, this._tTouchID, this._isLeftMouse);
          }),
          (e.check = function (t, e, i, n) {
            this._point.setTo(e, i),
              t.fromParentPoint(this._point),
              (e = this._point.x),
              (i = this._point.y);
            var s = t.scrollRect;
            if (
              s &&
              (this._rect.setTo(s.x, s.y, s.width, s.height),
              !this._rect.contains(e, i))
            )
              return !1;
            if (!this.disableMouseEvent) {
              if (t.hitTestPrior && !t.mouseThrough && !this.hitTest(t, e, i))
                return !1;
              for (var r = t._childs.length - 1; r > -1; r--) {
                var a = t._childs[r];
                if (
                  !a.destroyed &&
                  a.mouseEnabled &&
                  a.visible &&
                  this.check(a, e, i, n)
                )
                  return !0;
              }
            }
            var o =
              !(!t.hitTestPrior || t.mouseThrough || this.disableMouseEvent) ||
              this.hitTest(t, e, i);
            return (
              o
                ? ((this._target = t), n.call(this, t))
                : n === this.onMouseUp &&
                  t === this._stage &&
                  ((this._target = this._stage), n.call(this, this._target)),
              o
            );
          }),
          (e.hitTest = function (t, e, i) {
            var n = !1;
            if (
              (t.scrollRect && ((e -= t.scrollRect.x), (i -= t.scrollRect.y)),
              t.hitArea instanceof laya.utils.HitArea)
            )
              return t.hitArea.isHit(e, i);
            if ((t.width > 0 && t.height > 0) || t.mouseThrough || t.hitArea)
              if (t.mouseThrough) n = t.getGraphicBounds().contains(e, i);
              else {
                var s = this._rect;
                t.hitArea ? (s = t.hitArea) : s.setTo(0, 0, t.width, t.height),
                  (n = s.contains(e, i));
              }
            return n;
          }),
          (e.runEvent = function () {
            var e = this._eventList.length;
            if (e) {
              for (var i, n = 0, s = 0, r = 0; n < e; ) {
                var a = this._eventList[n];
                switch (
                  ("mousemove" !== a.type &&
                    (this._prePoint.x = this._prePoint.y = -1e6),
                  a.type)
                ) {
                  case "mousedown":
                    (this._touchIDs[0] = this._id++),
                      t._isTouchRespond
                        ? (t._isTouchRespond = !1)
                        : ((this._isLeftMouse = 0 === a.button),
                          this.initEvent(a),
                          this.check(
                            this._stage,
                            this.mouseX,
                            this.mouseY,
                            this.onMouseDown
                          ));
                    break;
                  case "mouseup":
                    (this._isLeftMouse = 0 === a.button),
                      this.initEvent(a),
                      this.check(
                        this._stage,
                        this.mouseX,
                        this.mouseY,
                        this.onMouseUp
                      );
                    break;
                  case "mousemove":
                    Math.abs(this._prePoint.x - a.clientX) +
                      Math.abs(this._prePoint.y - a.clientY) >=
                      this.mouseMoveAccuracy &&
                      ((this._prePoint.x = a.clientX),
                      (this._prePoint.y = a.clientY),
                      this.initEvent(a),
                      this.check(
                        this._stage,
                        this.mouseX,
                        this.mouseY,
                        this.onMouseMove
                      ));
                    break;
                  case "touchstart":
                    (t._isTouchRespond = !0), (this._isLeftMouse = !0);
                    var o = a.changedTouches;
                    for (s = 0, r = o.length; s < r; s++)
                      (i = o[s]),
                        (t.multiTouchEnabled || isNaN(this._curTouchID)) &&
                          ((this._curTouchID = i.identifier),
                          this._id % 200 == 0 && (this._touchIDs = {}),
                          (this._touchIDs[i.identifier] = this._id++),
                          this.initEvent(i, a),
                          this.check(
                            this._stage,
                            this.mouseX,
                            this.mouseY,
                            this.onMouseDown
                          ));
                    break;
                  case "touchend":
                  case "touchcancel":
                    (t._isTouchRespond = !0), (this._isLeftMouse = !0);
                    var h = a.changedTouches;
                    for (s = 0, r = h.length; s < r; s++)
                      if (
                        ((i = h[s]),
                        t.multiTouchEnabled || i.identifier == this._curTouchID)
                      ) {
                        (this._curTouchID = NaN), this.initEvent(i, a);
                        this.check(
                          this._stage,
                          this.mouseX,
                          this.mouseY,
                          this.onMouseUp
                        ) || this.onMouseUp(null);
                      }
                    break;
                  case "touchmove":
                    var l = a.changedTouches;
                    for (s = 0, r = l.length; s < r; s++)
                      (i = l[s]),
                        (t.multiTouchEnabled ||
                          i.identifier == this._curTouchID) &&
                          (this.initEvent(i, a),
                          this.check(
                            this._stage,
                            this.mouseX,
                            this.mouseY,
                            this.onMouseMove
                          ));
                    break;
                  case "wheel":
                  case "mousewheel":
                  case "DOMMouseScroll":
                    this.checkMouseWheel(a);
                    break;
                  case "mouseout":
                    TouchManager.I.stageMouseOut();
                    break;
                  case "mouseover":
                    this._stage.event(
                      "mouseover",
                      this._event.setTo("mouseover", this._stage, this._stage)
                    );
                }
                n++;
              }
              this._eventList.length = 0;
            }
          }),
          (t.enabled = !0),
          (t.multiTouchEnabled = !0),
          (t._isTouchRespond = !1),
          (t._isFirstTouch = !0),
          __static(t, [
            "instance",
            function () {
              return (this.instance = new t());
            },
          ]),
          t
        );
      })(),
      TouchManager = (function () {
        function t() {
          (this.preOvers = []),
            (this.preDowns = []),
            (this.preRightDowns = []),
            (this.enable = !0),
            (this._lastClickTime = 0),
            (this._event = new Event());
        }
        __class(t, "laya.events.TouchManager");
        var e = t.prototype;
        return (
          (e._clearTempArrs = function () {
            (t._oldArr.length = 0),
              (t._newArr.length = 0),
              (t._tEleArr.length = 0);
          }),
          (e.getTouchFromArr = function (t, e) {
            var i = 0,
              n = 0;
            n = e.length;
            var s;
            for (i = 0; i < n; i++) if ((s = e[i]).id == t) return s;
            return null;
          }),
          (e.removeTouchFromArr = function (t, e) {
            var i = 0;
            for (i = e.length - 1; i >= 0; i--) e[i].id == t && e.splice(i, 1);
          }),
          (e.createTouchO = function (t, e) {
            var i;
            return (
              (i = Pool.getItem("TouchData") || {}), (i.id = e), (i.tar = t), i
            );
          }),
          (e.onMouseDown = function (e, i, n) {
            if ((void 0 === n && (n = !1), this.enable)) {
              var s, r, a;
              (s = this.getTouchFromArr(i, this.preOvers)),
                (a = this.getEles(e, null, t._tEleArr)),
                s
                  ? (s.tar = e)
                  : ((r = this.createTouchO(e, i)), this.preOvers.push(r)),
                Browser.onMobile && this.sendEvents(a, "mouseover", i);
              var o;
              (o = n ? this.preDowns : this.preRightDowns),
                (s = this.getTouchFromArr(i, o))
                  ? (s.tar = e)
                  : ((r = this.createTouchO(e, i)), o.push(r)),
                this.sendEvents(a, n ? "mousedown" : "rightmousedown", i),
                this._clearTempArrs();
            }
          }),
          (e.sendEvents = function (t, e, i) {
            void 0 === i && (i = 0);
            var n = 0,
              s = 0;
            (s = t.length), (this._event._stoped = !1);
            var r;
            r = t[0];
            var a;
            for (n = 0; n < s; n++) {
              if ((a = t[n]).destroyed) return;
              if ((a.event(e, this._event.setTo(e, a, r)), this._event._stoped))
                break;
            }
          }),
          (e.getEles = function (t, e, i) {
            for (i ? (i.length = 0) : (i = []); t && t != e; )
              i.push(t), (t = t.parent);
            return i;
          }),
          (e.checkMouseOutAndOverOfMove = function (e, i, n) {
            if ((void 0 === n && (n = 0), i != e)) {
              var s,
                r,
                a = 0,
                o = 0;
              if (i.contains(e))
                (r = this.getEles(e, i, t._tEleArr)),
                  this.sendEvents(r, "mouseover", n);
              else if (e.contains(i))
                (r = this.getEles(i, e, t._tEleArr)),
                  this.sendEvents(r, "mouseout", n);
              else {
                (r = t._tEleArr).length = 0;
                var h;
                h = this.getEles(i, null, t._oldArr);
                var l;
                (l = this.getEles(e, null, t._newArr)), (o = h.length);
                var c = 0;
                for (a = 0; a < o; a++) {
                  if (((s = h[a]), (c = l.indexOf(s)) >= 0)) {
                    l.splice(c, l.length - c);
                    break;
                  }
                  r.push(s);
                }
                r.length > 0 && this.sendEvents(r, "mouseout", n),
                  l.length > 0 && this.sendEvents(l, "mouseover", n);
              }
            }
          }),
          (e.onMouseMove = function (e, i) {
            if (this.enable) {
              var n, s;
              (n = this.getTouchFromArr(i, this.preOvers))
                ? (this.checkMouseOutAndOverOfMove(e, n.tar),
                  (n.tar = e),
                  (s = this.getEles(e, null, t._tEleArr)))
                : ((s = this.getEles(e, null, t._tEleArr)),
                  this.sendEvents(s, "mouseover", i),
                  this.preOvers.push(this.createTouchO(e, i))),
                this.sendEvents(s, "mousemove", i),
                this._clearTempArrs();
            }
          }),
          (e.getLastOvers = function () {
            return (
              (t._tEleArr.length = 0),
              this.preOvers.length > 0 && this.preOvers[0].tar
                ? this.getEles(this.preOvers[0].tar, null, t._tEleArr)
                : (t._tEleArr.push(Laya.stage), t._tEleArr)
            );
          }),
          (e.stageMouseOut = function () {
            var t;
            (t = this.getLastOvers()),
              (this.preOvers.length = 0),
              this.sendEvents(t, "mouseout", 0);
          }),
          (e.onMouseUp = function (e, i, n) {
            if ((void 0 === n && (n = !1), this.enable)) {
              var s,
                r,
                a,
                o,
                h,
                l = 0,
                c = 0,
                u = Browser.onMobile;
              (r = this.getEles(e, null, t._tEleArr)),
                this.sendEvents(r, n ? "mouseup" : "rightmouseup", i);
              var _;
              if (
                ((_ = n ? this.preDowns : this.preRightDowns),
                (s = this.getTouchFromArr(i, _)))
              ) {
                var d = !1,
                  f = Browser.now();
                if (
                  ((d = f - this._lastClickTime < 300),
                  (this._lastClickTime = f),
                  e == s.tar)
                )
                  h = r;
                else
                  for (
                    a = this.getEles(s.tar, null, t._oldArr),
                      (h = t._newArr).length = 0,
                      c = a.length,
                      l = 0;
                    l < c;
                    l++
                  )
                    (o = a[l]), r.indexOf(o) >= 0 && h.push(o);
                h.length > 0 &&
                  this.sendEvents(h, n ? "click" : "rightclick", i),
                  n && d && this.sendEvents(h, "doubleclick", i),
                  this.removeTouchFromArr(i, _),
                  (s.tar = null),
                  Pool.recover("TouchData", s);
              } else;
              (s = this.getTouchFromArr(i, this.preOvers)) &&
                u &&
                ((h = this.getEles(s.tar, null, h)) &&
                  h.length > 0 &&
                  this.sendEvents(h, "mouseout", i),
                this.removeTouchFromArr(i, this.preOvers),
                (s.tar = null),
                Pool.recover("TouchData", s)),
                this._clearTempArrs();
            }
          }),
          (t._oldArr = []),
          (t._newArr = []),
          (t._tEleArr = []),
          __static(t, [
            "I",
            function () {
              return (this.I = new t());
            },
          ]),
          t
        );
      })(),
      Filter = (function () {
        function t() {
          this._action = null;
        }
        __class(t, "laya.filters.Filter");
        var e = t.prototype;
        return (
          Laya.imps(e, { "laya.filters.IFilter": !0 }),
          (e.callNative = function (t) {}),
          __getset(0, e, "type", function () {
            return -1;
          }),
          __getset(0, e, "action", function () {
            return this._action;
          }),
          (t.BLUR = 16),
          (t.COLOR = 32),
          (t.GLOW = 8),
          (t._filterStart = null),
          (t._filterEnd = null),
          (t._EndTarget = null),
          (t._recycleScope = null),
          (t._filter = null),
          (t._useSrc = null),
          (t._endSrc = null),
          (t._useOut = null),
          (t._endOut = null),
          t
        );
      })(),
      ColorFilterAction = (function () {
        function t() {
          this.data = null;
        }
        __class(t, "laya.filters.ColorFilterAction");
        var e = t.prototype;
        return (
          Laya.imps(e, { "laya.filters.IFilterAction": !0 }),
          (e.apply = function (t) {
            var e = t.ctx.ctx,
              i = t.ctx.ctx.canvas;
            if (0 == i.width || 0 == i.height) return i;
            for (
              var n,
                s = e.getImageData(0, 0, i.width, i.height),
                r = s.data,
                a = 0,
                o = r.length;
              a < o;
              a += 4
            )
              (n = this.getColor(r[a], r[a + 1], r[a + 2], r[a + 3])),
                0 != r[a + 3] &&
                  ((r[a] = n[0]),
                  (r[a + 1] = n[1]),
                  (r[a + 2] = n[2]),
                  (r[a + 3] = n[3]));
            return e.putImageData(s, 0, 0), t;
          }),
          (e.getColor = function (t, e, i, n) {
            var s = [];
            if (this.data._mat && this.data._alpha) {
              var r = this.data._mat,
                a = this.data._alpha;
              (s[0] = r[0] * t + r[1] * e + r[2] * i + r[3] * n + a[0]),
                (s[1] = r[4] * t + r[5] * e + r[6] * i + r[7] * n + a[1]),
                (s[2] = r[8] * t + r[9] * e + r[10] * i + r[11] * n + a[2]),
                (s[3] = r[12] * t + r[13] * e + r[14] * i + r[15] * n + a[3]);
            }
            return s;
          }),
          t
        );
      })(),
      Arith = (function () {
        function t() {}
        return (
          __class(t, "laya.maths.Arith"),
          (t.formatR = function (t) {
            return (
              t > Math.PI && (t -= 2 * Math.PI),
              t < -Math.PI && (t += 2 * Math.PI),
              t
            );
          }),
          (t.isPOT = function (t, e) {
            return t > 0 && 0 == (t & (t - 1)) && e > 0 && 0 == (e & (e - 1));
          }),
          (t.setMatToArray = function (t, e) {
            t.a,
              t.b,
              t.c,
              t.d,
              t.tx,
              t.ty,
              (e[0] = t.a),
              (e[1] = t.b),
              (e[4] = t.c),
              (e[5] = t.d),
              (e[12] = t.tx),
              (e[13] = t.ty);
          }),
          t
        );
      })(),
      Bezier = (function () {
        function t() {
          (this._controlPoints = [new Point(), new Point(), new Point()]),
            (this._calFun = this.getPoint2);
        }
        __class(t, "laya.maths.Bezier");
        var e = t.prototype;
        return (
          (e._switchPoint = function (t, e) {
            var i = this._controlPoints.shift();
            i.setTo(t, e), this._controlPoints.push(i);
          }),
          (e.getPoint2 = function (t, e) {
            var i = this._controlPoints[0],
              n = this._controlPoints[1],
              s = this._controlPoints[2],
              r =
                Math.pow(1 - t, 2) * i.x +
                2 * t * (1 - t) * n.x +
                Math.pow(t, 2) * s.x,
              a =
                Math.pow(1 - t, 2) * i.y +
                2 * t * (1 - t) * n.y +
                Math.pow(t, 2) * s.y;
            e.push(r, a);
          }),
          (e.getPoint3 = function (t, e) {
            var i = this._controlPoints[0],
              n = this._controlPoints[1],
              s = this._controlPoints[2],
              r = this._controlPoints[3],
              a =
                Math.pow(1 - t, 3) * i.x +
                3 * n.x * t * (1 - t) * (1 - t) +
                3 * s.x * t * t * (1 - t) +
                r.x * Math.pow(t, 3),
              o =
                Math.pow(1 - t, 3) * i.y +
                3 * n.y * t * (1 - t) * (1 - t) +
                3 * s.y * t * t * (1 - t) +
                r.y * Math.pow(t, 3);
            e.push(a, o);
          }),
          (e.insertPoints = function (t, e) {
            var i = NaN,
              n = NaN;
            for (n = 1 / (t = t > 0 ? t : 5), i = 0; i <= 1; i += n)
              this._calFun(i, e);
          }),
          (e.getBezierPoints = function (t, e, i) {
            void 0 === e && (e = 5), void 0 === i && (i = 2);
            var n = 0,
              s = 0;
            if ((s = t.length) < 2 * (i + 1)) return [];
            var r;
            switch (((r = []), i)) {
              case 2:
                this._calFun = this.getPoint2;
                break;
              case 3:
                this._calFun = this.getPoint3;
                break;
              default:
                return [];
            }
            for (; this._controlPoints.length <= i; )
              this._controlPoints.push(new Point());
            for (n = 0; n < 2 * i; n += 2) this._switchPoint(t[n], t[n + 1]);
            for (n = 2 * i; n < s; n += 2)
              this._switchPoint(t[n], t[n + 1]),
                (n / 2) % i == 0 && this.insertPoints(e, r);
            return r;
          }),
          __static(t, [
            "I",
            function () {
              return (this.I = new t());
            },
          ]),
          t
        );
      })(),
      GrahamScan = (function () {
        function t() {}
        return (
          __class(t, "laya.maths.GrahamScan"),
          (t.multiply = function (t, e, i) {
            return (t.x - i.x) * (e.y - i.y) - (e.x - i.x) * (t.y - i.y);
          }),
          (t.dis = function (t, e) {
            return (t.x - e.x) * (t.x - e.x) + (t.y - e.y) * (t.y - e.y);
          }),
          (t._getPoints = function (e, i, n) {
            for (
              void 0 === i && (i = !1), t._mPointList || (t._mPointList = []);
              t._mPointList.length < e;

            )
              t._mPointList.push(new Point());
            return (
              n || (n = []),
              (n.length = 0),
              i
                ? t.getFrom(n, t._mPointList, e)
                : t.getFromR(n, t._mPointList, e),
              n
            );
          }),
          (t.getFrom = function (t, e, i) {
            var n = 0;
            for (n = 0; n < i; n++) t.push(e[n]);
            return t;
          }),
          (t.getFromR = function (t, e, i) {
            var n = 0;
            for (n = 0; n < i; n++) t.push(e.pop());
            return t;
          }),
          (t.pListToPointList = function (e, i) {
            void 0 === i && (i = !1);
            var n = 0,
              s = e.length / 2,
              r = t._getPoints(s, i, t._tempPointList);
            for (n = 0; n < s; n++) r[n].setTo(e[n + n], e[n + n + 1]);
            return r;
          }),
          (t.pointListToPlist = function (e) {
            var i,
              n = 0,
              s = e.length,
              r = t._temPList;
            for (r.length = 0, n = 0; n < s; n++) (i = e[n]), r.push(i.x, i.y);
            return r;
          }),
          (t.scanPList = function (e) {
            return Utils.copyArray(
              e,
              t.pointListToPlist(t.scan(t.pListToPointList(e, !0)))
            );
          }),
          (t.scan = function (e) {
            var i,
              n,
              s,
              r = 0,
              a = 0,
              o = 0,
              h = e.length,
              l = {};
            for (
              (n = t._temArr).length = 0, r = (h = e.length) - 1;
              r >= 0;
              r--
            )
              (s = (i = e[r]).x + "_" + i.y),
                l.hasOwnProperty(s) || ((l[s] = !0), n.push(i));
            for (h = n.length, Utils.copyArray(e, n), r = 1; r < h; r++)
              (e[r].y < e[o].y || (e[r].y == e[o].y && e[r].x < e[o].x)) &&
                (o = r);
            for (i = e[0], e[0] = e[o], e[o] = i, r = 1; r < h - 1; r++) {
              for (o = r, a = r + 1; a < h; a++)
                (t.multiply(e[a], e[o], e[0]) > 0 ||
                  (0 == t.multiply(e[a], e[o], e[0]) &&
                    t.dis(e[0], e[a]) < t.dis(e[0], e[o]))) &&
                  (o = a);
              (i = e[r]), (e[r] = e[o]), (e[o] = i);
            }
            if (((n = t._temArr), (n.length = 0), e.length < 3))
              return Utils.copyArray(n, e);
            for (n.push(e[0], e[1], e[2]), r = 3; r < h; r++) {
              for (
                ;
                n.length >= 2 &&
                t.multiply(e[r], n[n.length - 1], n[n.length - 2]) >= 0;

              )
                n.pop();
              e[r] && n.push(e[r]);
            }
            return n;
          }),
          (t._mPointList = null),
          (t._tempPointList = []),
          (t._temPList = []),
          (t._temArr = []),
          t
        );
      })(),
      MathUtil = (function () {
        function t() {}
        return (
          __class(t, "laya.maths.MathUtil"),
          (t.subtractVector3 = function (t, e, i) {
            (i[0] = t[0] - e[0]), (i[1] = t[1] - e[1]), (i[2] = t[2] - e[2]);
          }),
          (t.lerp = function (t, e, i) {
            return t * (1 - i) + e * i;
          }),
          (t.scaleVector3 = function (t, e, i) {
            (i[0] = t[0] * e), (i[1] = t[1] * e), (i[2] = t[2] * e);
          }),
          (t.lerpVector3 = function (t, e, i, n) {
            var s = t[0],
              r = t[1],
              a = t[2];
            (n[0] = s + i * (e[0] - s)),
              (n[1] = r + i * (e[1] - r)),
              (n[2] = a + i * (e[2] - a));
          }),
          (t.lerpVector4 = function (t, e, i, n) {
            var s = t[0],
              r = t[1],
              a = t[2],
              o = t[3];
            (n[0] = s + i * (e[0] - s)),
              (n[1] = r + i * (e[1] - r)),
              (n[2] = a + i * (e[2] - a)),
              (n[3] = o + i * (e[3] - o));
          }),
          (t.slerpQuaternionArray = function (t, e, i, n, s, r, a) {
            var o,
              h,
              l,
              c,
              u,
              _ = t[e + 0],
              d = t[e + 1],
              f = t[e + 2],
              p = t[e + 3],
              g = i[n + 0],
              m = i[n + 1],
              v = i[n + 2],
              y = i[n + 3];
            return (
              (h = _ * g + d * m + f * v + p * y) < 0 &&
                ((h = -h), (g = -g), (m = -m), (v = -v), (y = -y)),
              1 - h > 1e-6
                ? ((o = Math.acos(h)),
                  (l = Math.sin(o)),
                  (c = Math.sin((1 - s) * o) / l),
                  (u = Math.sin(s * o) / l))
                : ((c = 1 - s), (u = s)),
              (r[a + 0] = c * _ + u * g),
              (r[a + 1] = c * d + u * m),
              (r[a + 2] = c * f + u * v),
              (r[a + 3] = c * p + u * y),
              r
            );
          }),
          (t.getRotation = function (t, e, i, n) {
            return (Math.atan2(n - e, i - t) / Math.PI) * 180;
          }),
          (t.sortBigFirst = function (t, e) {
            return t == e ? 0 : e > t ? 1 : -1;
          }),
          (t.sortSmallFirst = function (t, e) {
            return t == e ? 0 : e > t ? -1 : 1;
          }),
          (t.sortNumBigFirst = function (t, e) {
            return parseFloat(e) - parseFloat(t);
          }),
          (t.sortNumSmallFirst = function (t, e) {
            return parseFloat(t) - parseFloat(e);
          }),
          (t.sortByKey = function (e, i, n) {
            void 0 === i && (i = !1), void 0 === n && (n = !0);
            var s;
            return (
              (s = i
                ? n
                  ? t.sortNumBigFirst
                  : t.sortBigFirst
                : n
                ? t.sortNumSmallFirst
                : t.sortSmallFirst),
              function (t, i) {
                return s(t[e], i[e]);
              }
            );
          }),
          t
        );
      })(),
      Matrix = (function () {
        function t(t, e, i, n, s, r) {
          (this.inPool = !1),
            (this.bTransform = !1),
            void 0 === t && (t = 1),
            void 0 === e && (e = 0),
            void 0 === i && (i = 0),
            void 0 === n && (n = 1),
            void 0 === s && (s = 0),
            void 0 === r && (r = 0),
            (this.a = t),
            (this.b = e),
            (this.c = i),
            (this.d = n),
            (this.tx = s),
            (this.ty = r),
            this._checkTransform();
        }
        __class(t, "laya.maths.Matrix");
        var e = t.prototype;
        return (
          (e.identity = function () {
            return (
              (this.a = this.d = 1),
              (this.b = this.tx = this.ty = this.c = 0),
              (this.bTransform = !1),
              this
            );
          }),
          (e._checkTransform = function () {
            return (this.bTransform =
              1 !== this.a || 0 !== this.b || 0 !== this.c || 1 !== this.d);
          }),
          (e.setTranslate = function (t, e) {
            return (this.tx = t), (this.ty = e), this;
          }),
          (e.translate = function (t, e) {
            return (this.tx += t), (this.ty += e), this;
          }),
          (e.scale = function (t, e) {
            (this.a *= t),
              (this.d *= e),
              (this.c *= t),
              (this.b *= e),
              (this.tx *= t),
              (this.ty *= e),
              (this.bTransform = !0);
          }),
          (e.rotate = function (t) {
            var e = Math.cos(t),
              i = Math.sin(t),
              n = this.a,
              s = this.c,
              r = this.tx;
            (this.a = n * e - this.b * i),
              (this.b = n * i + this.b * e),
              (this.c = s * e - this.d * i),
              (this.d = s * i + this.d * e),
              (this.tx = r * e - this.ty * i),
              (this.ty = r * i + this.ty * e),
              (this.bTransform = !0);
          }),
          (e.skew = function (t, e) {
            var i = Math.tan(t),
              n = Math.tan(e),
              s = this.a,
              r = this.b;
            return (
              (this.a += n * this.c),
              (this.b += n * this.d),
              (this.c += i * s),
              (this.d += i * r),
              this
            );
          }),
          (e.invertTransformPoint = function (t) {
            var e = this.a,
              i = this.b,
              n = this.c,
              s = this.d,
              r = this.tx,
              a = e * s - i * n,
              o = s / a,
              h = -i / a,
              l = -n / a,
              c = e / a,
              u = (n * this.ty - s * r) / a,
              _ = -(e * this.ty - i * r) / a;
            return t.setTo(o * t.x + l * t.y + u, h * t.x + c * t.y + _);
          }),
          (e.transformPoint = function (t) {
            return t.setTo(
              this.a * t.x + this.c * t.y + this.tx,
              this.b * t.x + this.d * t.y + this.ty
            );
          }),
          (e.transformPointN = function (t) {
            return t.setTo(
              this.a * t.x + this.c * t.y,
              this.b * t.x + this.d * t.y
            );
          }),
          (e.transformPointArray = function (t, e) {
            for (var i = t.length, n = 0; n < i; n += 2) {
              var s = t[n],
                r = t[n + 1];
              (e[n] = this.a * s + this.c * r + this.tx),
                (e[n + 1] = this.b * s + this.d * r + this.ty);
            }
            return e;
          }),
          (e.transformPointArrayScale = function (t, e) {
            for (var i = t.length, n = 0; n < i; n += 2) {
              var s = t[n],
                r = t[n + 1];
              (e[n] = this.a * s + this.c * r),
                (e[n + 1] = this.b * s + this.d * r);
            }
            return e;
          }),
          (e.getScaleX = function () {
            return 0 === this.b
              ? this.a
              : Math.sqrt(this.a * this.a + this.b * this.b);
          }),
          (e.getScaleY = function () {
            return 0 === this.c
              ? this.d
              : Math.sqrt(this.c * this.c + this.d * this.d);
          }),
          (e.invert = function () {
            var t = this.a,
              e = this.b,
              i = this.c,
              n = this.d,
              s = this.tx,
              r = t * n - e * i;
            return (
              (this.a = n / r),
              (this.b = -e / r),
              (this.c = -i / r),
              (this.d = t / r),
              (this.tx = (i * this.ty - n * s) / r),
              (this.ty = -(t * this.ty - e * s) / r),
              this
            );
          }),
          (e.setTo = function (t, e, i, n, s, r) {
            return (
              (this.a = t),
              (this.b = e),
              (this.c = i),
              (this.d = n),
              (this.tx = s),
              (this.ty = r),
              this
            );
          }),
          (e.concat = function (t) {
            var e = this.a,
              i = this.c,
              n = this.tx;
            return (
              (this.a = e * t.a + this.b * t.c),
              (this.b = e * t.b + this.b * t.d),
              (this.c = i * t.a + this.d * t.c),
              (this.d = i * t.b + this.d * t.d),
              (this.tx = n * t.a + this.ty * t.c + t.tx),
              (this.ty = n * t.b + this.ty * t.d + t.ty),
              this
            );
          }),
          (e.scaleEx = function (t, e) {
            var i = this.a,
              n = this.b,
              s = this.c,
              r = this.d;
            0 !== n || 0 !== s
              ? ((this.a = t * i),
                (this.b = t * n),
                (this.c = e * s),
                (this.d = e * r))
              : ((this.a = t * i),
                (this.b = 0 * r),
                (this.c = 0 * i),
                (this.d = e * r)),
              (this.bTransform = !0);
          }),
          (e.rotateEx = function (t) {
            var e = Math.cos(t),
              i = Math.sin(t),
              n = this.a,
              s = this.b,
              r = this.c,
              a = this.d;
            0 !== s || 0 !== r
              ? ((this.a = e * n + i * r),
                (this.b = e * s + i * a),
                (this.c = -i * n + e * r),
                (this.d = -i * s + e * a))
              : ((this.a = e * n),
                (this.b = i * a),
                (this.c = -i * n),
                (this.d = e * a)),
              (this.bTransform = !0);
          }),
          (e.clone = function () {
            var e = t.create();
            return (
              (e.a = this.a),
              (e.b = this.b),
              (e.c = this.c),
              (e.d = this.d),
              (e.tx = this.tx),
              (e.ty = this.ty),
              (e.bTransform = this.bTransform),
              e
            );
          }),
          (e.copyTo = function (t) {
            return (
              (t.a = this.a),
              (t.b = this.b),
              (t.c = this.c),
              (t.d = this.d),
              (t.tx = this.tx),
              (t.ty = this.ty),
              (t.bTransform = this.bTransform),
              t
            );
          }),
          (e.toString = function () {
            return (
              this.a +
              "," +
              this.b +
              "," +
              this.c +
              "," +
              this.d +
              "," +
              this.tx +
              "," +
              this.ty
            );
          }),
          (e.destroy = function () {
            if (!this.inPool) {
              var e = t._cache;
              (this.inPool = !0),
                e._length || (e._length = 0),
                (e[e._length++] = this),
                (this.a = this.d = 1),
                (this.b = this.c = this.tx = this.ty = 0),
                (this.bTransform = !1);
            }
          }),
          (t.mul = function (t, e, i) {
            var n = t.a,
              s = t.b,
              r = t.c,
              a = t.d,
              o = t.tx,
              h = t.ty,
              l = e.a,
              c = e.b,
              u = e.c,
              _ = e.d,
              d = e.tx,
              f = e.ty;
            return (
              0 !== c || 0 !== u
                ? ((i.a = n * l + s * u),
                  (i.b = n * c + s * _),
                  (i.c = r * l + a * u),
                  (i.d = r * c + a * _),
                  (i.tx = l * o + u * h + d),
                  (i.ty = c * o + _ * h + f))
                : ((i.a = n * l),
                  (i.b = s * _),
                  (i.c = r * l),
                  (i.d = a * _),
                  (i.tx = l * o + d),
                  (i.ty = _ * h + f)),
              i
            );
          }),
          (t.mul16 = function (t, e, i) {
            var n = t.a,
              s = t.b,
              r = t.c,
              a = t.d,
              o = t.tx,
              h = t.ty,
              l = e.a,
              c = e.b,
              u = e.c,
              _ = e.d,
              d = e.tx,
              f = e.ty;
            return (
              0 !== c || 0 !== u
                ? ((i[0] = n * l + s * u),
                  (i[1] = n * c + s * _),
                  (i[4] = r * l + a * u),
                  (i[5] = r * c + a * _),
                  (i[12] = l * o + u * h + d),
                  (i[13] = c * o + _ * h + f))
                : ((i[0] = n * l),
                  (i[1] = s * _),
                  (i[4] = r * l),
                  (i[5] = a * _),
                  (i[12] = l * o + d),
                  (i[13] = _ * h + f)),
              i
            );
          }),
          (t.mulPre = function (t, e, i, n, s, r, a, o) {
            var h = t.a,
              l = t.b,
              c = t.c,
              u = t.d,
              _ = t.tx,
              d = t.ty;
            return (
              0 !== i || 0 !== n
                ? ((o.a = h * e + l * n),
                  (o.b = h * i + l * s),
                  (o.c = c * e + u * n),
                  (o.d = c * i + u * s),
                  (o.tx = e * _ + n * d + r),
                  (o.ty = i * _ + s * d + a))
                : ((o.a = h * e),
                  (o.b = l * s),
                  (o.c = c * e),
                  (o.d = u * s),
                  (o.tx = e * _ + r),
                  (o.ty = s * d + a)),
              o
            );
          }),
          (t.mulPos = function (t, e, i, n, s, r, a, o) {
            var h = t.a,
              l = t.b,
              c = t.c,
              u = t.d,
              _ = t.tx,
              d = t.ty;
            return (
              0 !== l || 0 !== c
                ? ((o.a = e * h + i * c),
                  (o.b = e * l + i * u),
                  (o.c = n * h + s * c),
                  (o.d = n * l + s * u),
                  (o.tx = h * r + c * a + _),
                  (o.ty = l * r + u * a + d))
                : ((o.a = e * h),
                  (o.b = i * u),
                  (o.c = n * h),
                  (o.d = s * u),
                  (o.tx = h * r + _),
                  (o.ty = u * a + d)),
              o
            );
          }),
          (t.preMul = function (t, e, i) {
            var n = t.a,
              s = t.b,
              r = t.c,
              a = t.d,
              o = e.a,
              h = e.b,
              l = e.c,
              c = e.d,
              u = e.tx,
              _ = e.ty;
            return (
              (i.a = o * n),
              (i.b = i.c = 0),
              (i.d = c * a),
              (i.tx = u * n + t.tx),
              (i.ty = _ * a + t.ty),
              (0 === h && 0 === l && 0 === s && 0 === r) ||
                ((i.a += h * r),
                (i.d += l * s),
                (i.b += o * s + h * a),
                (i.c += l * n + c * r),
                (i.tx += _ * r),
                (i.ty += u * s)),
              i
            );
          }),
          (t.preMulXY = function (t, e, i, n) {
            var s = t.a,
              r = t.b,
              a = t.c,
              o = t.d;
            return (
              (n.a = s),
              (n.b = r),
              (n.c = a),
              (n.d = o),
              (n.tx = e * s + t.tx + i * a),
              (n.ty = i * o + t.ty + e * r),
              n
            );
          }),
          (t.create = function () {
            var e = t._cache,
              i = e._length ? e[--e._length] : new t();
            return (i.inPool = !1), i;
          }),
          (t.EMPTY = new t()),
          (t.TEMP = new t()),
          (t._cache = []),
          t
        );
      })(),
      Point = (function () {
        function t(t, e) {
          void 0 === t && (t = 0),
            void 0 === e && (e = 0),
            (this.x = t),
            (this.y = e);
        }
        __class(t, "laya.maths.Point");
        var e = t.prototype;
        return (
          (e.setTo = function (t, e) {
            return (this.x = t), (this.y = e), this;
          }),
          (e.distance = function (t, e) {
            return Math.sqrt(
              (this.x - t) * (this.x - t) + (this.y - e) * (this.y - e)
            );
          }),
          (e.toString = function () {
            return this.x + "," + this.y;
          }),
          (e.normalize = function () {
            var t = Math.sqrt(this.x * this.x + this.y * this.y);
            if (t > 0) {
              var e = 1 / t;
              (this.x *= e), (this.y *= e);
            }
          }),
          (t.TEMP = new t()),
          (t.EMPTY = new t()),
          t
        );
      })(),
      Rectangle = (function () {
        function t(t, e, i, n) {
          void 0 === t && (t = 0),
            void 0 === e && (e = 0),
            void 0 === i && (i = 0),
            void 0 === n && (n = 0),
            (this.x = t),
            (this.y = e),
            (this.width = i),
            (this.height = n);
        }
        __class(t, "laya.maths.Rectangle");
        var e = t.prototype;
        return (
          (e.setTo = function (t, e, i, n) {
            return (
              (this.x = t),
              (this.y = e),
              (this.width = i),
              (this.height = n),
              this
            );
          }),
          (e.copyFrom = function (t) {
            return (
              (this.x = t.x),
              (this.y = t.y),
              (this.width = t.width),
              (this.height = t.height),
              this
            );
          }),
          (e.contains = function (t, e) {
            return (
              !(this.width <= 0 || this.height <= 0) &&
              t >= this.x &&
              t < this.right &&
              e >= this.y &&
              e < this.bottom
            );
          }),
          (e.intersects = function (t) {
            return !(
              t.x > this.x + this.width ||
              t.x + t.width < this.x ||
              t.y > this.y + this.height ||
              t.y + t.height < this.y
            );
          }),
          (e.intersection = function (e, i) {
            return this.intersects(e)
              ? (i || (i = new t()),
                (i.x = Math.max(this.x, e.x)),
                (i.y = Math.max(this.y, e.y)),
                (i.width = Math.min(this.right, e.right) - i.x),
                (i.height = Math.min(this.bottom, e.bottom) - i.y),
                i)
              : null;
          }),
          (e.union = function (e, i) {
            return (
              i || (i = new t()),
              this.clone(i),
              e.width <= 0 || e.height <= 0
                ? i
                : (i.addPoint(e.x, e.y), i.addPoint(e.right, e.bottom), this)
            );
          }),
          (e.clone = function (e) {
            return (
              e || (e = new t()),
              (e.x = this.x),
              (e.y = this.y),
              (e.width = this.width),
              (e.height = this.height),
              e
            );
          }),
          (e.toString = function () {
            return this.x + "," + this.y + "," + this.width + "," + this.height;
          }),
          (e.equals = function (t) {
            return !(
              !t ||
              t.x !== this.x ||
              t.y !== this.y ||
              t.width !== this.width ||
              t.height !== this.height
            );
          }),
          (e.addPoint = function (t, e) {
            return (
              this.x > t && ((this.width += this.x - t), (this.x = t)),
              this.y > e && ((this.height += this.y - e), (this.y = e)),
              this.width < t - this.x && (this.width = t - this.x),
              this.height < e - this.y && (this.height = e - this.y),
              this
            );
          }),
          (e._getBoundPoints = function () {
            var e = t._temB;
            return (
              (e.length = 0),
              0 == this.width || 0 == this.height
                ? e
                : (e.push(
                    this.x,
                    this.y,
                    this.x + this.width,
                    this.y,
                    this.x,
                    this.y + this.height,
                    this.x + this.width,
                    this.y + this.height
                  ),
                  e)
            );
          }),
          (e.isEmpty = function () {
            return this.width <= 0 || this.height <= 0;
          }),
          __getset(0, e, "right", function () {
            return this.x + this.width;
          }),
          __getset(0, e, "bottom", function () {
            return this.y + this.height;
          }),
          (t._getBoundPointS = function (e, i, n, s) {
            var r = t._temA;
            return (
              (r.length = 0),
              0 == n || 0 == s
                ? r
                : (r.push(e, i, e + n, i, e, i + s, e + n, i + s), r)
            );
          }),
          (t._getWrapRec = function (e, i) {
            if (!e || e.length < 1)
              return i ? i.setTo(0, 0, 0, 0) : t.TEMP.setTo(0, 0, 0, 0);
            i = i || new t();
            var n,
              s,
              r,
              a,
              o,
              h = e.length,
              l = Point.TEMP;
            for (r = o = -(s = a = 99999), n = 0; n < h; n += 2)
              (l.x = e[n]),
                (l.y = e[n + 1]),
                (s = s < l.x ? s : l.x),
                (a = a < l.y ? a : l.y),
                (r = r > l.x ? r : l.x),
                (o = o > l.y ? o : l.y);
            return i.setTo(s, a, r - s, o - a);
          }),
          (t.EMPTY = new t()),
          (t.TEMP = new t()),
          (t._temB = []),
          (t._temA = []),
          t
        );
      })(),
      SoundManager = (function () {
        function t() {}
        return (
          __class(t, "laya.media.SoundManager"),
          __getset(
            1,
            t,
            "useAudioMusic",
            function () {
              return t._useAudioMusic;
            },
            function (e) {
              (t._useAudioMusic = e), e && (t._musicClass = AudioSound);
            }
          ),
          __getset(
            1,
            t,
            "autoStopMusic",
            function () {
              return t._autoStopMusic;
            },
            function (e) {
              Laya.stage.off("blur", null, t._stageOnBlur),
                Laya.stage.off("focus", null, t._stageOnFocus),
                Laya.stage.off("visibilitychange", null, t._visibilityChange),
                (t._autoStopMusic = e),
                e &&
                  (Laya.stage.on("blur", null, t._stageOnBlur),
                  Laya.stage.on("focus", null, t._stageOnFocus),
                  Laya.stage.on("visibilitychange", null, t._visibilityChange));
            }
          ),
          __getset(
            1,
            t,
            "muted",
            function () {
              return t._muted;
            },
            function (e) {
              e != t._muted &&
                (e && t.stopAllSound(), (t.musicMuted = e), (t._muted = e));
            }
          ),
          __getset(
            1,
            t,
            "musicMuted",
            function () {
              return t._musicMuted;
            },
            function (e) {
              e != t._musicMuted &&
                (e
                  ? (t._tMusic && t._musicChannel && !t._musicChannel.isStopped
                      ? t._musicChannel.pause()
                      : (t._musicChannel = null),
                    (t._musicMuted = e))
                  : ((t._musicMuted = e),
                    t._tMusic && t._musicChannel && t._musicChannel.resume()));
            }
          ),
          __getset(
            1,
            t,
            "soundMuted",
            function () {
              return t._soundMuted;
            },
            function (e) {
              t._soundMuted = e;
            }
          ),
          (t.addChannel = function (e) {
            t._channels.indexOf(e) >= 0 || t._channels.push(e);
          }),
          (t.removeChannel = function (e) {
            var i = 0;
            for (i = t._channels.length - 1; i >= 0; i--)
              t._channels[i] == e && t._channels.splice(i, 1);
          }),
          (t.disposeSoundIfNotUsed = function (e) {
            var i = 0;
            for (i = t._channels.length - 1; i >= 0; i--)
              if (t._channels[i].url == e) return;
            t.destroySound(e);
          }),
          (t._visibilityChange = function () {
            Laya.stage.isVisibility ? t._stageOnFocus() : t._stageOnBlur();
          }),
          (t._stageOnBlur = function () {
            (t._isActive = !1),
              t._musicChannel &&
                (t._musicChannel.isStopped ||
                  ((t._blurPaused = !0),
                  t._musicChannel.pause(),
                  Laya.stage.once("mousedown", null, t._stageOnFocus))),
              t.stopAllSound();
          }),
          (t._stageOnFocus = function () {
            (t._isActive = !0),
              Laya.stage.off("mousedown", null, t._stageOnFocus),
              t._blurPaused &&
                t._musicChannel &&
                t._musicChannel.isStopped &&
                ((t._blurPaused = !1), t._musicChannel.resume());
          }),
          (t.playSound = function (e, i, n, s, r) {
            if (
              (void 0 === i && (i = 1),
              void 0 === r && (r = 0),
              !t._isActive || !e)
            )
              return null;
            if (t._muted) return null;
            if ((e = URL.formatURL(e)) == t._tMusic) {
              if (t._musicMuted) return null;
            } else {
              if (Render.isConchApp) {
                var a = Utils.getFileExtension(e);
                if ("wav" != a && "ogg" != a)
                  return (
                    alert(
                      "The sound only supports wav or ogg format,for optimal performance reason,please refer to the official website document."
                    ),
                    null
                  );
              }
              if (t._soundMuted) return null;
            }
            var o;
            Browser.onMiniGame || (o = Laya.loader.getRes(e)),
              s || (s = t._soundClass),
              o || ((o = new s()).load(e), Loader.cacheRes(e, o));
            var h;
            return (h = o.play(r, i))
              ? ((h.url = e),
                (h.volume = e == t._tMusic ? t.musicVolume : t.soundVolume),
                (h.completeHandler = n),
                h)
              : null;
          }),
          (t.destroySound = function (t) {
            var e = Laya.loader.getRes(t);
            e && (Loader.clearRes(t), e.dispose());
          }),
          (t.playMusic = function (e, i, n, s) {
            return (
              void 0 === i && (i = 0),
              void 0 === s && (s = 0),
              (e = URL.formatURL(e)),
              (t._tMusic = e),
              t._musicChannel && t._musicChannel.stop(),
              (t._musicChannel = t.playSound(e, i, n, t._musicClass, s))
            );
          }),
          (t.stopSound = function (e) {
            e = URL.formatURL(e);
            var i,
              n = 0;
            for (n = t._channels.length - 1; n >= 0; n--)
              (i = t._channels[n]).url == e && i.stop();
          }),
          (t.stopAll = function () {
            t._tMusic = null;
            var e = 0;
            for (e = t._channels.length - 1; e >= 0; e--) t._channels[e].stop();
          }),
          (t.stopAllSound = function () {
            var e,
              i = 0;
            for (i = t._channels.length - 1; i >= 0; i--)
              (e = t._channels[i]).url != t._tMusic && e.stop();
          }),
          (t.stopMusic = function () {
            t._musicChannel && t._musicChannel.stop(), (t._tMusic = null);
          }),
          (t.setSoundVolume = function (e, i) {
            if (i) (i = URL.formatURL(i)), t._setVolume(i, e);
            else {
              t.soundVolume = e;
              var n,
                s = 0;
              for (s = t._channels.length - 1; s >= 0; s--)
                (n = t._channels[s]).url != t._tMusic && (n.volume = e);
            }
          }),
          (t.setMusicVolume = function (e) {
            (t.musicVolume = e), t._setVolume(t._tMusic, e);
          }),
          (t._setVolume = function (e, i) {
            e = URL.formatURL(e);
            var n,
              s = 0;
            for (s = t._channels.length - 1; s >= 0; s--)
              (n = t._channels[s]).url == e && (n.volume = i);
          }),
          (t.musicVolume = 1),
          (t.soundVolume = 1),
          (t.playbackRate = 1),
          (t._useAudioMusic = !0),
          (t._muted = !1),
          (t._soundMuted = !1),
          (t._musicMuted = !1),
          (t._tMusic = null),
          (t._musicChannel = null),
          (t._channels = []),
          (t._autoStopMusic = !1),
          (t._blurPaused = !1),
          (t._isActive = !0),
          (t._soundClass = null),
          (t._musicClass = null),
          (t.autoReleaseSound = !0),
          t
        );
      })(),
      LocalStorage = (function () {
        function t() {}
        var e;
        return (
          __class(t, "laya.net.LocalStorage"),
          (t.__init__ = function () {
            t._baseClass || ((t._baseClass = e), e.init()),
              (t.items = t._baseClass.items),
              (t.support = t._baseClass.support);
          }),
          (t.setItem = function (e, i) {
            t._baseClass.setItem(e, i);
          }),
          (t.getItem = function (e) {
            return t._baseClass.getItem(e);
          }),
          (t.setJSON = function (e, i) {
            t._baseClass.setJSON(e, i);
          }),
          (t.getJSON = function (e) {
            return t._baseClass.getJSON(e);
          }),
          (t.removeItem = function (e) {
            t._baseClass.removeItem(e);
          }),
          (t.clear = function () {
            t._baseClass.clear();
          }),
          (t._baseClass = null),
          (t.items = null),
          (t.support = !1),
          (t.__init$ = function () {
            e = (function () {
              function t() {}
              return (
                __class(t, ""),
                (t.init = function () {
                  try {
                    (t.items = window.localStorage),
                      t.setItem("laya", "1"),
                      t.removeItem("laya"),
                      (t.support = !0);
                  } catch (t) {}
                  t.support ||
                    console.log(
                      "LocalStorage is not supprot or browser is private mode."
                    );
                }),
                (t.setItem = function (e, i) {
                  try {
                    t.support && t.items.setItem(e, i);
                  } catch (t) {
                    console.warn("set localStorage failed", t);
                  }
                }),
                (t.getItem = function (e) {
                  return t.support ? t.items.getItem(e) : null;
                }),
                (t.setJSON = function (e, i) {
                  try {
                    t.support && t.items.setItem(e, JSON.stringify(i));
                  } catch (t) {
                    console.warn("set localStorage failed", t);
                  }
                }),
                (t.getJSON = function (e) {
                  return JSON.parse(t.support ? t.items.getItem(e) : null);
                }),
                (t.removeItem = function (e) {
                  t.support && t.items.removeItem(e);
                }),
                (t.clear = function () {
                  t.support && t.items.clear();
                }),
                (t.items = null),
                (t.support = !1),
                t
              );
            })();
          }),
          t
        );
      })(),
      ResourceVersion = (function () {
        function t() {}
        return (
          __class(t, "laya.net.ResourceVersion"),
          (t.enable = function (e, i, n) {
            void 0 === n && (n = 2),
              (laya.net.ResourceVersion.type = n),
              Laya.loader.load(
                e,
                Handler.create(null, t.onManifestLoaded, [i]),
                null,
                "json"
              ),
              (URL.customFormat = t.addVersionPrefix);
          }),
          (t.onManifestLoaded = function (e, i) {
            (t.manifest = i),
              e.run(),
              i ||
                console.warn(
                  "资源版本清单文件不存在，不使用资源版本管理。忽略ERR_FILE_NOT_FOUND错误。"
                );
          }),
          (t.addVersionPrefix = function (e) {
            return t.manifest && t.manifest[e]
              ? 2 == t.type
                ? t.manifest[e]
                : t.manifest[e] + "/" + e
              : e;
          }),
          (t.FOLDER_VERSION = 1),
          (t.FILENAME_VERSION = 2),
          (t.manifest = null),
          (t.type = 1),
          t
        );
      })(),
      TTFLoader = (function () {
        function t() {
          (this.fontName = null),
            (this.complete = null),
            (this.err = null),
            (this._fontTxt = null),
            (this._url = null),
            (this._div = null),
            (this._txtWidth = NaN),
            (this._http = null);
        }
        __class(t, "laya.net.TTFLoader");
        var e = t.prototype;
        return (
          (e.load = function (t) {
            this._url = t;
            var e = t.split(".ttf")[0].split("/");
            (this.fontName = e[e.length - 1]),
              Browser.window.conch
                ? this._loadConch()
                : Browser.window.FontFace
                ? this._loadWithFontFace()
                : this._loadWithCSS();
          }),
          (e._loadConch = function () {
            (this._http = new HttpRequest()),
              this._http.on("error", this, this._onErr),
              this._http.on("complete", this, this._onHttpLoaded),
              this._http.send(this._url, null, "get", "arraybuffer");
          }),
          (e._onHttpLoaded = function (t) {
            Browser.window.conch.setFontFaceFromBuffer(this.fontName, t),
              this._clearHttp(),
              this._complete();
          }),
          (e._clearHttp = function () {
            this._http &&
              (this._http.off("error", this, this._onErr),
              this._http.off("complete", this, this._onHttpLoaded),
              (this._http = null));
          }),
          (e._onErr = function () {
            this._clearHttp(),
              this.err &&
                (this.err.runWith("fail:" + this._url), (this.err = null));
          }),
          (e._complete = function () {
            Laya.timer.clear(this, this._complete),
              Laya.timer.clear(this, this._checkComplete),
              this._div &&
                this._div.parentNode &&
                (this._div.parentNode.removeChild(this._div),
                (this._div = null)),
              this.complete &&
                (this.complete.runWith(this), (this.complete = null));
          }),
          (e._checkComplete = function () {
            RunDriver.measureText("LayaTTFFont", this._fontTxt).width !=
              this._txtWidth && this._complete();
          }),
          (e._loadWithFontFace = function () {
            var t = new Browser.window.FontFace(
              this.fontName,
              "url('" + this._url + "')"
            );
            Browser.window.document.fonts.add(t);
            var e = this;
            t.loaded.then(function () {
              e._complete();
            }),
              t.load();
          }),
          (e._createDiv = function () {
            (this._div = Browser.createElement("div")),
              (this._div.innerHTML = "laya");
            var t = this._div.style;
            (t.fontFamily = this.fontName),
              (t.position = "absolute"),
              (t.left = "-100px"),
              (t.top = "-100px"),
              Browser.document.body.appendChild(this._div);
          }),
          (e._loadWithCSS = function () {
            var t = this,
              e = Browser.createElement("style");
            (e.type = "text/css"),
              Browser.document.body.appendChild(e),
              (e.textContent =
                "@font-face { font-family:'" +
                this.fontName +
                "'; src:url('" +
                this._url +
                "');}"),
              (this._fontTxt = "40px " + this.fontName),
              (this._txtWidth = RunDriver.measureText(
                "LayaTTFFont",
                this._fontTxt
              ).width);
            var i = this;
            (e.onload = function () {
              Laya.timer.once(1e4, i, t._complete);
            }),
              Laya.timer.loop(20, this, this._checkComplete),
              this._createDiv();
          }),
          (t._testString = "LayaTTFFont"),
          t
        );
      })(),
      URL = (function () {
        function t(e) {
          (this._url = null),
            (this._path = null),
            (this._url = t.formatURL(e)),
            (this._path = t.getPath(e));
        }
        __class(t, "laya.net.URL");
        var e = t.prototype;
        return (
          __getset(0, e, "path", function () {
            return this._path;
          }),
          __getset(0, e, "url", function () {
            return this._url;
          }),
          (t.formatURL = function (e, i) {
            if (!e) return "null path";
            if (e.indexOf(":") > 0) return e;
            null != t.customFormat && (e = t.customFormat(e, i));
            var n = e.charAt(0);
            if ("." === n) return t.formatRelativePath((i || t.basePath) + e);
            if ("~" === n) return t.rootPath + e.substring(1);
            if ("d" === n) {
              if (0 === e.indexOf("data:image")) return e;
            } else if ("/" === n) return e;
            return (i || t.basePath) + e;
          }),
          (t.formatRelativePath = function (t) {
            for (var e = t.split("/"), i = 0, n = e.length; i < n; i++)
              ".." == e[i] && (e.splice(i - 1, 2), (i -= 2));
            return e.join("/");
          }),
          (t.isAbsolute = function (t) {
            return t.indexOf(":") > 0 || "/" == t.charAt(0);
          }),
          (t.getPath = function (t) {
            var e = t.lastIndexOf("/");
            return e > 0 ? t.substr(0, e + 1) : "";
          }),
          (t.getFileName = function (t) {
            var e = t.lastIndexOf("/");
            return e > 0 ? t.substr(e + 1) : t;
          }),
          (t.version = {}),
          (t.basePath = ""),
          (t.rootPath = ""),
          (t.customFormat = function (e) {
            var i = t.version[e];
            return !Render.isConchApp && i && (e += "?v=" + i), e;
          }),
          t
        );
      })(),
      Render = (function () {
        function t(e, i) {
          function n() {
            Laya.stage._loop(), Browser.window.requestAnimationFrame(n);
          }
          this._timeId = 0;
          var s = t._mainCanvas.source.style;
          (s.position = "absolute"),
            (s.top = s.left = "0px"),
            (s.background = "#000000"),
            (t._mainCanvas.source.id = "layaCanvas");
          var r = laya.renders.Render.isWebGL;
          (t._mainCanvas.source.width = e),
            (t._mainCanvas.source.height = i),
            r && t.WebGL.init(t._mainCanvas, e, i),
            Browser.container.appendChild(t._mainCanvas.source),
            (t._context = new RenderContext(
              e,
              i,
              r ? null : t._mainCanvas
            )).ctx.setIsMainContext(),
            Browser.window.requestAnimationFrame(n),
            Laya.stage.on("visibilitychange", this, this._onVisibilitychange);
        }
        __class(t, "laya.renders.Render");
        var e = t.prototype;
        return (
          (e._onVisibilitychange = function () {
            Laya.stage.isVisibility
              ? 0 != this._timeId && Browser.window.clearInterval(this._timeId)
              : (this._timeId = Browser.window.setInterval(
                  this._enterFrame,
                  1e3
                ));
          }),
          (e._enterFrame = function (t) {
            Laya.stage._loop();
          }),
          __getset(1, t, "context", function () {
            return t._context;
          }),
          __getset(1, t, "canvas", function () {
            return t._mainCanvas.source;
          }),
          (t._context = null),
          (t._mainCanvas = null),
          (t.WebGL = null),
          (t.isConchNode = !1),
          (t.isConchApp = !1),
          (t.isConchWebGL = !1),
          (t.isWebGL = !1),
          (t.is3DMode = !1),
          (t.optimizeTextureMemory = function (t, e) {
            return !0;
          }),
          (t.__init$ = function () {
            (window.ConchRenderType = window.ConchRenderType || 1),
              (window.ConchRenderType |= window.conch ? 4 : 0),
              (t.isConchNode = 5 == (5 & window.ConchRenderType)),
              (t.isConchApp = 4 == (4 & window.ConchRenderType)),
              (t.isConchWebGL = 6 == window.ConchRenderType);
          }),
          t
        );
      })(),
      RenderContext = (function () {
        function t(e, i, n) {
          (this.x = 0),
            (this.y = 0),
            (this._drawTexture = function (t, e, i) {
              i[0].loaded &&
                this.ctx.drawTexture(i[0], i[1], i[2], i[3], i[4], t, e);
            }),
            (this._fillTexture = function (t, e, i) {
              i[0].loaded &&
                this.ctx.fillTexture(
                  i[0],
                  i[1] + t,
                  i[2] + e,
                  i[3],
                  i[4],
                  i[5],
                  i[6],
                  i[7]
                );
            }),
            (this._drawTextureWithTransform = function (t, e, i) {
              i[0].loaded &&
                this.ctx.drawTextureWithTransform(
                  i[0],
                  i[1],
                  i[2],
                  i[3],
                  i[4],
                  i[5],
                  t,
                  e,
                  i[6]
                );
            }),
            (this._fillQuadrangle = function (t, e, i) {
              this.ctx.fillQuadrangle(i[0], i[1], i[2], i[3], i[4]);
            }),
            (this._drawRect = function (t, e, i) {
              var n = this.ctx;
              null != i[4] &&
                ((n.fillStyle = i[4]),
                n.fillRect(t + i[0], e + i[1], i[2], i[3], null)),
                null != i[5] &&
                  ((n.strokeStyle = i[5]),
                  (n.lineWidth = i[6]),
                  n.strokeRect(t + i[0], e + i[1], i[2], i[3], i[6]));
            }),
            (this._drawPie = function (t, e, i) {
              var n = this.ctx;
              Render.isWebGL && n.setPathId(i[8]),
                n.beginPath(),
                Render.isWebGL
                  ? (n.movePath(i[0] + t, i[1] + e), n.moveTo(0, 0))
                  : n.moveTo(t + i[0], e + i[1]),
                n.arc(t + i[0], e + i[1], i[2], i[3], i[4]),
                n.closePath(),
                this._fillAndStroke(i[5], i[6], i[7], !0);
            }),
            (this._clipRect = function (t, e, i) {
              this.ctx.clipRect(t + i[0], e + i[1], i[2], i[3]);
            }),
            (this._fillRect = function (t, e, i) {
              this.ctx.fillRect(t + i[0], e + i[1], i[2], i[3], i[4]);
            }),
            (this._drawCircle = function (e, i, n) {
              var s = this.ctx;
              Render.isWebGL && s.setPathId(n[6]),
                Stat.drawCall++,
                s.beginPath(),
                Render.isWebGL && s.movePath(n[0] + e, n[1] + i),
                s.arc(n[0] + e, n[1] + i, n[2], 0, t.PI2),
                s.closePath(),
                this._fillAndStroke(n[3], n[4], n[5], !0);
            }),
            (this._fillCircle = function (e, i, n) {
              Stat.drawCall++;
              var s = this.ctx;
              s.beginPath(),
                (s.fillStyle = n[3]),
                s.arc(n[0] + e, n[1] + i, n[2], 0, t.PI2),
                s.fill();
            }),
            (this._setShader = function (t, e, i) {
              this.ctx.setShader(i[0]);
            }),
            (this._drawLine = function (t, e, i) {
              var n = this.ctx;
              Render.isWebGL && n.setPathId(i[6]),
                n.beginPath(),
                (n.strokeStyle = i[4]),
                (n.lineWidth = i[5]),
                Render.isWebGL
                  ? (n.movePath(t, e),
                    n.moveTo(i[0], i[1]),
                    n.lineTo(i[2], i[3]))
                  : (n.moveTo(t + i[0], e + i[1]),
                    n.lineTo(t + i[2], e + i[3])),
                n.stroke();
            }),
            (this._drawLines = function (t, e, i) {
              var n = this.ctx;
              Render.isWebGL && n.setPathId(i[5]),
                n.beginPath(),
                (t += i[0]),
                (e += i[1]),
                Render.isWebGL && n.movePath(t, e),
                (n.strokeStyle = i[3]),
                (n.lineWidth = i[4]);
              var s = i[2],
                r = 2,
                a = s.length;
              if (Render.isWebGL)
                for (n.moveTo(s[0], s[1]); r < a; ) n.lineTo(s[r++], s[r++]);
              else
                for (n.moveTo(t + s[0], e + s[1]); r < a; )
                  n.lineTo(t + s[r++], e + s[r++]);
              n.stroke();
            }),
            (this._drawLinesWebGL = function (t, e, i) {
              this.ctx.drawLines(
                t + this.x + i[0],
                e + this.y + i[1],
                i[2],
                i[3],
                i[4]
              );
            }),
            (this._drawCurves = function (t, e, i) {
              this.ctx.drawCurves(t, e, i);
            }),
            (this._draw = function (t, e, i) {
              i[0].call(null, this, t, e);
            }),
            (this._transformByMatrix = function (t, e, i) {
              this.ctx.transformByMatrix(i[0]);
            }),
            (this._setTransform = function (t, e, i) {
              this.ctx.setTransform(i[0], i[1], i[2], i[3], i[4], i[5]);
            }),
            (this._setTransformByMatrix = function (t, e, i) {
              this.ctx.setTransformByMatrix(i[0]);
            }),
            (this._save = function (t, e, i) {
              this.ctx.save();
            }),
            (this._restore = function (t, e, i) {
              this.ctx.restore();
            }),
            (this._translate = function (t, e, i) {
              this.ctx.translate(i[0], i[1]);
            }),
            (this._transform = function (t, e, i) {
              this.ctx.translate(i[1] + t, i[2] + e);
              var n = i[0];
              this.ctx.transform(n.a, n.b, n.c, n.d, n.tx, n.ty),
                this.ctx.translate(-t - i[1], -e - i[2]);
            }),
            (this._rotate = function (t, e, i) {
              this.ctx.translate(i[1] + t, i[2] + e),
                this.ctx.rotate(i[0]),
                this.ctx.translate(-t - i[1], -e - i[2]);
            }),
            (this._scale = function (t, e, i) {
              this.ctx.translate(i[2] + t, i[3] + e),
                this.ctx.scale(i[0], i[1]),
                this.ctx.translate(-t - i[2], -e - i[3]);
            }),
            (this._alpha = function (t, e, i) {
              this.ctx.globalAlpha *= i[0];
            }),
            (this._setAlpha = function (t, e, i) {
              this.ctx.globalAlpha = i[0];
            }),
            (this._fillText = function (t, e, i) {
              this.ctx.fillText(i[0], i[1] + t, i[2] + e, i[3], i[4], i[5]);
            }),
            (this._strokeText = function (t, e, i) {
              this.ctx.strokeText(
                i[0],
                i[1] + t,
                i[2] + e,
                i[3],
                i[4],
                i[5],
                i[6]
              );
            }),
            (this._fillBorderText = function (t, e, i) {
              this.ctx.fillBorderText(
                i[0],
                i[1] + t,
                i[2] + e,
                i[3],
                i[4],
                i[5],
                i[6],
                i[7]
              );
            }),
            (this._blendMode = function (t, e, i) {
              this.ctx.globalCompositeOperation = i[0];
            }),
            (this._beginClip = function (t, e, i) {
              this.ctx.beginClip &&
                this.ctx.beginClip(t + i[0], e + i[1], i[2], i[3]);
            }),
            (this._setIBVB = function (t, e, i) {
              this.ctx.setIBVB(
                i[0] + t,
                i[1] + e,
                i[2],
                i[3],
                i[4],
                i[5],
                i[6],
                i[7]
              );
            }),
            (this._fillTrangles = function (t, e, i) {
              this.ctx.fillTrangles(i[0], i[1] + t, i[2] + e, i[3], i[4]);
            }),
            (this._drawPath = function (t, e, i) {
              var n = this.ctx;
              Render.isWebGL && n.setPathId(-1),
                n.beginPath(),
                (t += i[0]),
                (e += i[1]),
                Render.isWebGL && n.movePath(t, e);
              for (var s = i[2], r = 0, a = s.length; r < a; r++) {
                var o = s[r];
                switch (o[0]) {
                  case "moveTo":
                    Render.isWebGL
                      ? n.moveTo(o[1], o[2])
                      : n.moveTo(t + o[1], e + o[2]);
                    break;
                  case "lineTo":
                    Render.isWebGL
                      ? n.lineTo(o[1], o[2])
                      : n.lineTo(t + o[1], e + o[2]);
                    break;
                  case "arcTo":
                    Render.isWebGL
                      ? n.arcTo(o[1], o[2], o[3], o[4], o[5])
                      : n.arcTo(t + o[1], e + o[2], t + o[3], e + o[4], o[5]);
                    break;
                  case "closePath":
                    n.closePath();
                }
              }
              var h = i[3];
              null != h && ((n.fillStyle = h.fillStyle), n.fill());
              var l = i[4];
              null != l &&
                ((n.strokeStyle = l.strokeStyle),
                (n.lineWidth = l.lineWidth || 1),
                (n.lineJoin = l.lineJoin),
                (n.lineCap = l.lineCap),
                (n.miterLimit = l.miterLimit),
                n.stroke());
            }),
            (this.drawPoly = function (t, e, i) {
              this.ctx.drawPoly(
                t + this.x + i[0],
                e + this.y + i[1],
                i[2],
                i[3],
                i[4],
                i[5],
                i[6]
              );
            }),
            (this._drawPoly = function (t, e, i) {
              var n = this.ctx,
                s = i[2],
                r = 2,
                a = s.length;
              if (Render.isWebGL)
                for (
                  n.setPathId(i[6]),
                    n.beginPath(),
                    t += i[0],
                    e += i[1],
                    n.movePath(t, e),
                    n.moveTo(s[0], s[1]);
                  r < a;

                )
                  n.lineTo(s[r++], s[r++]);
              else
                for (
                  n.beginPath(),
                    t += i[0],
                    e += i[1],
                    n.moveTo(t + s[0], e + s[1]);
                  r < a;

                )
                  n.lineTo(t + s[r++], e + s[r++]);
              n.closePath(), this._fillAndStroke(i[3], i[4], i[5], i[7]);
            }),
            (this._drawSkin = function (t, e, i) {
              var n = i[0];
              if (n) {
                var s = this.ctx;
                n.render(s, t, e);
              }
            }),
            (this._drawParticle = function (t, e, i) {
              this.ctx.drawParticle(t + this.x, e + this.y, i[0]);
            }),
            (this._setFilters = function (t, e, i) {
              this.ctx.setFilters(i);
            }),
            n
              ? (this.ctx = n.getContext("2d"))
              : ((n = HTMLCanvas.create("3D")),
                (this.ctx = RunDriver.createWebGLContext2D(n)),
                n._setContext(this.ctx)),
            n.size(e, i),
            (this.canvas = n);
        }
        __class(t, "laya.renders.RenderContext");
        var e = t.prototype;
        return (
          (e.destroy = function () {
            this.canvas &&
              (this.canvas.destroy(), (this.canvas = null), (this.ctx = null)),
              this.ctx && (this.ctx.destroy(), (this.ctx = null));
          }),
          (e.drawTexture = function (t, e, i, n, s) {
            t.loaded && this.ctx.drawTexture(t, e, i, n, s, this.x, this.y);
          }),
          (e._drawTextures = function (t, e, i) {
            i[0].loaded &&
              this.ctx.drawTextures(i[0], i[1], t + this.x, e + this.y);
          }),
          (e.drawTextureWithTransform = function (t, e, i, n, s, r, a) {
            t.loaded &&
              this.ctx.drawTextureWithTransform(
                t,
                e,
                i,
                n,
                s,
                r,
                this.x,
                this.y,
                a
              );
          }),
          (e.fillQuadrangle = function (t, e, i, n, s) {
            this.ctx.fillQuadrangle(t, e, i, n, s);
          }),
          (e.drawCanvas = function (t, e, i, n, s) {
            this.ctx.drawCanvas(t, e + this.x, i + this.y, n, s);
          }),
          (e.drawRect = function (t, e, i, n, s, r) {
            void 0 === r && (r = 1);
            var a = this.ctx;
            (a.strokeStyle = s),
              (a.lineWidth = r),
              a.strokeRect(t + this.x, e + this.y, i, n, r);
          }),
          (e._fillAndStroke = function (t, e, i, n) {
            void 0 === n && (n = !1);
            var s = this.ctx;
            null != t &&
              ((s.fillStyle = t), Render.isWebGL ? s.fill(n) : s.fill()),
              null != e &&
                i > 0 &&
                ((s.strokeStyle = e), (s.lineWidth = i), s.stroke());
          }),
          (e.clipRect = function (t, e, i, n) {
            this.ctx.clipRect(t + this.x, e + this.y, i, n);
          }),
          (e.fillRect = function (t, e, i, n, s) {
            this.ctx.fillRect(t + this.x, e + this.y, i, n, s);
          }),
          (e.drawCircle = function (e, i, n, s, r) {
            void 0 === r && (r = 1), Stat.drawCall++;
            var a = this.ctx;
            a.beginPath(),
              (a.strokeStyle = s),
              (a.lineWidth = r),
              a.arc(e + this.x, i + this.y, n, 0, t.PI2),
              a.stroke();
          }),
          (e.drawTriangles = function (t, e, i) {
            if (Render.isWebGL)
              this.ctx.drawTriangles(
                i[0],
                t + i[1],
                e + i[2],
                i[3],
                i[4],
                i[5],
                i[6],
                i[7],
                i[8],
                i[9]
              );
            else {
              var n = i[5],
                s = 0,
                r = n.length,
                a = this.ctx;
              for (s = 0; s < r; s += 3) {
                var o = 2 * n[s],
                  h = 2 * n[s + 1],
                  l = 2 * n[s + 2];
                a.drawTriangle(i[0], i[3], i[4], o, h, l, i[6], !0);
              }
            }
          }),
          (e.fillCircle = function (e, i, n, s) {
            Stat.drawCall++;
            var r = this.ctx;
            r.beginPath(),
              (r.fillStyle = s),
              r.arc(e + this.x, i + this.y, n, 0, t.PI2),
              r.fill();
          }),
          (e.setShader = function (t) {
            this.ctx.setShader(t);
          }),
          (e.drawLine = function (t, e, i, n, s, r) {
            void 0 === r && (r = 1);
            var a = this.ctx;
            a.beginPath(),
              (a.strokeStyle = s),
              (a.lineWidth = r),
              a.moveTo(this.x + t, this.y + e),
              a.lineTo(this.x + i, this.y + n),
              a.stroke();
          }),
          (e.clear = function () {
            this.ctx.clear();
          }),
          (e.transformByMatrix = function (t) {
            this.ctx.transformByMatrix(t);
          }),
          (e.setTransform = function (t, e, i, n, s, r) {
            this.ctx.setTransform(t, e, i, n, s, r);
          }),
          (e.setTransformByMatrix = function (t) {
            this.ctx.setTransformByMatrix(t);
          }),
          (e.save = function () {
            this.ctx.save();
          }),
          (e.restore = function () {
            this.ctx.restore();
          }),
          (e.translate = function (t, e) {
            this.ctx.translate(t, e);
          }),
          (e.transform = function (t, e, i, n, s, r) {
            this.ctx.transform(t, e, i, n, s, r);
          }),
          (e.rotate = function (t) {
            this.ctx.rotate(t);
          }),
          (e.scale = function (t, e) {
            this.ctx.scale(t, e);
          }),
          (e.alpha = function (t) {
            this.ctx.globalAlpha *= t;
          }),
          (e.setAlpha = function (t) {
            this.ctx.globalAlpha = t;
          }),
          (e.fillWords = function (t, e, i, n, s, r) {
            void 0 === r && (r = 0), this.ctx.fillWords(t, e, i, n, s, r);
          }),
          (e.fillBorderWords = function (t, e, i, n, s, r, a) {
            this.ctx.fillBorderWords(t, e, i, n, s, r, a);
          }),
          (e.fillText = function (t, e, i, n, s, r) {
            this.ctx.fillText(t, e + this.x, i + this.y, n, s, r);
          }),
          (e.strokeText = function (t, e, i, n, s, r, a) {
            this.ctx.strokeText(t, e + this.x, i + this.y, n, s, r, a);
          }),
          (e.blendMode = function (t) {
            this.ctx.globalCompositeOperation = t;
          }),
          (e.flush = function () {
            this.ctx.flush && this.ctx.flush();
          }),
          (e.addRenderObject = function (t) {
            this.ctx.addRenderObject(t);
          }),
          (e.beginClip = function (t, e, i, n) {
            this.ctx.beginClip && this.ctx.beginClip(t, e, i, n);
          }),
          (e.endClip = function () {
            this.ctx.endClip && this.ctx.endClip();
          }),
          (e.fillTrangles = function (t, e, i) {
            this.ctx.fillTrangles(
              i[0],
              i[1],
              i[2],
              i[3],
              i.length > 4 ? i[4] : null
            );
          }),
          (t.PI2 = 2 * Math.PI),
          t
        );
      })(),
      RenderSprite = (function () {
        function t(e, i) {
          switch (((this._next = i || t.NORENDER), e)) {
            case 0:
              return void (this._fun = this._no);
            case 1:
              return void (this._fun = this._image);
            case 2:
              return void (this._fun = this._alpha);
            case 4:
              return void (this._fun = this._transform);
            case 8:
              return void (this._fun = this._blend);
            case 16:
              return void (this._fun = this._canvas);
            case 64:
              return void (this._fun = this._mask);
            case 128:
              return void (this._fun = this._clip);
            case 256:
              return void (this._fun = this._style);
            case 512:
              return void (this._fun = this._graphics);
            case 2048:
              return void (this._fun = this._childs);
            case 1024:
              return void (this._fun = this._custom);
            case 513:
            case 517:
              return void (this._fun = this._image2);
            case 32:
              return void (this._fun = Filter._filter);
            case 69905:
              return void (this._fun = t._initRenderFun);
          }
          this.onCreate(e);
        }
        __class(t, "laya.renders.RenderSprite");
        var e = t.prototype;
        return (
          (e.onCreate = function (t) {}),
          (e._style = function (t, e, i, n) {
            t._style.render(t, e, i, n);
            var s = this._next;
            s._fun.call(s, t, e, i, n);
          }),
          (e._no = function (t, e, i, n) {}),
          (e._custom = function (t, e, i, n) {
            t.customRender(e, i, n);
            var s = t._style._tf;
            this._next._fun.call(
              this._next,
              t,
              e,
              i - s.translateX,
              n - s.translateY
            );
          }),
          (e._clip = function (e, i, n, s) {
            var r = this._next;
            if (r != t.NORENDER) {
              var a = e._style.scrollRect;
              i.ctx.save(),
                i.ctx.clipRect(n, s, a.width, a.height),
                r._fun.call(r, e, i, n - a.x, s - a.y),
                i.ctx.restore();
            }
          }),
          (e._blend = function (t, e, i, n) {
            var s = t._style;
            s.blendMode && (e.ctx.globalCompositeOperation = s.blendMode);
            var r = this._next;
            r._fun.call(r, t, e, i, n),
              (e.ctx.globalCompositeOperation = "source-over");
          }),
          (e._mask = function (t, e, i, n) {
            var s = this._next;
            s._fun.call(s, t, e, i, n);
            var r = t.mask;
            r &&
              ((e.ctx.globalCompositeOperation = "destination-in"),
              (r.numChildren > 0 || !r.graphics._isOnlyOne()) &&
                (r.cacheAsBitmap = !0),
              r.render(e, i - t.pivotX, n - t.pivotY)),
              (e.ctx.globalCompositeOperation = "source-over");
          }),
          (e._graphics = function (t, e, i, n) {
            var s = t._style._tf;
            t._graphics &&
              t._graphics._render(t, e, i - s.translateX, n - s.translateY);
            var r = this._next;
            r._fun.call(r, t, e, i, n);
          }),
          (e._image = function (t, e, i, n) {
            var s = t._style;
            e.ctx.drawTexture2(
              i,
              n,
              s._tf.translateX,
              s._tf.translateY,
              t.transform,
              s.alpha,
              s.blendMode,
              t._graphics._one
            );
          }),
          (e._image2 = function (t, e, i, n) {
            var s = t._style._tf;
            e.ctx.drawTexture2(
              i,
              n,
              s.translateX,
              s.translateY,
              t.transform,
              1,
              null,
              t._graphics._one
            );
          }),
          (e._alpha = function (t, e, i, n) {
            var s;
            if ((s = t._style.alpha) > 0.01 || t._needRepaint()) {
              var r = e.ctx.globalAlpha;
              e.ctx.globalAlpha *= s;
              var a = this._next;
              a._fun.call(a, t, e, i, n), (e.ctx.globalAlpha = r);
            }
          }),
          (e._transform = function (e, i, n, s) {
            var r = e.transform,
              a = this._next;
            r && a != t.NORENDER
              ? (i.save(),
                i.transform(r.a, r.b, r.c, r.d, r.tx + n, r.ty + s),
                a._fun.call(a, e, i, 0, 0),
                i.restore())
              : a._fun.call(a, e, i, n, s);
          }),
          (e._childs = function (t, e, i, n) {
            var s = t._style,
              r = s._tf;
            if (
              ((i = i - r.translateX + s.paddingLeft),
              (n = n - r.translateY + s.paddingTop),
              s._calculation)
            ) {
              var a = t._getWords();
              if (a) {
                var o = s;
                o &&
                  (o.stroke
                    ? e.fillBorderWords(
                        a,
                        i,
                        n,
                        o.font,
                        o.color,
                        o.strokeColor,
                        o.stroke
                      )
                    : e.fillWords(a, i, n, o.font, o.color, o.underLine));
              }
            }
            var h,
              l = t._childs,
              c = l.length;
            if (t.viewport || (t.optimizeScrollRect && t._style.scrollRect)) {
              var u = t.viewport || t._style.scrollRect,
                _ = u.x,
                d = u.y,
                f = u.right,
                p = u.bottom,
                g = NaN,
                m = NaN;
              for (v = 0; v < c; ++v)
                (h = l[v]).visible &&
                  (g = h._x) < f &&
                  g + h.width > _ &&
                  (m = h._y) < p &&
                  m + h.height > d &&
                  h.render(e, i, n);
            } else
              for (var v = 0; v < c; ++v)
                (h = l[v])._style.visible && h.render(e, i, n);
          }),
          (e._canvas = function (t, e, i, n) {
            var s = t._$P.cacheCanvas;
            if (s) {
              "bitmap" === s.type ? Stat.canvasBitmap++ : Stat.canvasNormal++;
              var r = s.ctx;
              if (t._needRepaint() || !r) this._canvas_repaint(t, e, i, n);
              else {
                var a = s._cacheRec;
                e.drawCanvas(r.canvas, i + a.x, n + a.y, a.width, a.height);
              }
            } else this._next._fun.call(this._next, t, e, i, n);
          }),
          (e._canvas_repaint = function (t, e, i, n) {
            var s = t._$P.cacheCanvas,
              r = this._next;
            if (s) {
              var a,
                o,
                h,
                l,
                c = s.ctx,
                u = t._needRepaint() || !c,
                _ = s.type;
              if (
                ("bitmap" === _ ? Stat.canvasBitmap++ : Stat.canvasNormal++, u)
              ) {
                s._cacheRec || (s._cacheRec = new Rectangle());
                var d, f;
                Render.isWebGL && "bitmap" !== _
                  ? s._cacheRec.setTo(-t.pivotX, -t.pivotY, 1, 1)
                  : (((l = t.getSelfBounds()).x = l.x - t.pivotX),
                    (l.y = l.y - t.pivotY),
                    (l.x = l.x - 16),
                    (l.y = l.y - 16),
                    (l.width = l.width + 32),
                    (l.height = l.height + 32),
                    (l.x = Math.floor(l.x + i) - i),
                    (l.y = Math.floor(l.y + n) - n),
                    (l.width = Math.floor(l.width)),
                    (l.height = Math.floor(l.height)),
                    s._cacheRec.copyFrom(l)),
                  (l = s._cacheRec);
                var p = Render.isWebGL
                    ? 1
                    : Browser.pixelRatio * Laya.stage.clientScaleX,
                  g = Render.isWebGL
                    ? 1
                    : Browser.pixelRatio * Laya.stage.clientScaleY;
                if (!Render.isWebGL) {
                  var m,
                    v = 1,
                    y = 1;
                  for (m = t; m && m != Laya.stage; )
                    (v *= m.scaleX), (y *= m.scaleY), (m = m.parent);
                  Render.isWebGL
                    ? (v < 1 && (p *= v), y < 1 && (g *= y))
                    : (v > 1 && (p *= v), y > 1 && (g *= y));
                }
                if (t.scrollRect) {
                  var w = t.scrollRect;
                  (l.x -= w.x), (l.y -= w.y);
                }
                if (
                  ((d = l.width * p),
                  (f = l.height * g),
                  (o = l.x),
                  (h = l.y),
                  Render.isWebGL && "bitmap" === _ && (d > 2048 || f > 2048))
                )
                  return (
                    console.warn(
                      "cache bitmap size larger than 2048,cache ignored"
                    ),
                    s.ctx &&
                      (Pool.recover("RenderContext", s.ctx),
                      s.ctx.canvas.size(0, 0),
                      (s.ctx = null)),
                    void r._fun.call(r, t, e, i, n)
                  );
                c ||
                  (c = s.ctx =
                    Pool.getItem("RenderContext") ||
                    new RenderContext(d, f, HTMLCanvas.create("AUTO"))),
                  (c.ctx.sprite = t),
                  (a = c.canvas).clear(),
                  (a.width != d || a.height != f) && a.size(d, f),
                  "bitmap" === _
                    ? (a.context.asBitmap = !0)
                    : "normal" === _ && (a.context.asBitmap = !1);
                var x;
                if (1 != p || 1 != g) {
                  var T = c.ctx;
                  T.save(),
                    T.scale(p, g),
                    !Render.isConchWebGL &&
                      Render.isConchApp &&
                      (x = t._$P.cf) &&
                      T.setFilterMatrix &&
                      T.setFilterMatrix(x._mat, x._alpha),
                    r._fun.call(r, t, c, -o, -h),
                    T.restore(),
                    (Render.isConchApp && !Render.isConchWebGL) ||
                      t._applyFilters();
                } else
                  (T = c.ctx),
                    !Render.isConchWebGL &&
                      Render.isConchApp &&
                      (x = t._$P.cf) &&
                      T.setFilterMatrix &&
                      T.setFilterMatrix(x._mat, x._alpha),
                    r._fun.call(r, t, c, -o, -h),
                    (Render.isConchApp && !Render.isConchWebGL) ||
                      t._applyFilters();
                t._$P.staticCache && (s.reCache = !1), Stat.canvasReCache++;
              } else (o = (l = s._cacheRec).x), (h = l.y), (a = c.canvas);
              e.drawCanvas(a, i + o, n + h, l.width, l.height);
            } else r._fun.call(r, t, c, i, n);
          }),
          (t.__init__ = function () {
            var e,
              i = 0,
              n = 0;
            for (
              e = RunDriver.createRenderSprite(69905, null),
                n = t.renders.length = 4096,
                i = 0;
              i < n;
              i++
            )
              t.renders[i] = e;
            (t.renders[0] = RunDriver.createRenderSprite(0, null)),
              (function (e, i) {
                for (var n = 0, s = 0; s < e.length; s++)
                  (n |= e[s]), (t.renders[n] = i);
              })([1, 512, 4, 2], new t(1, null)),
              (t.renders[513] = RunDriver.createRenderSprite(513, null)),
              (t.renders[517] = new t(517, null));
          }),
          (t._initRenderFun = function (e, i, n, s) {
            var r = e._renderType;
            (t.renders[r] = t._getTypeRender(r))._fun(e, i, n, s);
          }),
          (t._getTypeRender = function (t) {
            for (var e = null, i = 2048; i > 1; )
              i & t && (e = RunDriver.createRenderSprite(i, e)), (i >>= 1);
            return e;
          }),
          (t.IMAGE = 1),
          (t.ALPHA = 2),
          (t.TRANSFORM = 4),
          (t.BLEND = 8),
          (t.CANVAS = 16),
          (t.FILTERS = 32),
          (t.MASK = 64),
          (t.CLIP = 128),
          (t.STYLE = 256),
          (t.GRAPHICS = 512),
          (t.CUSTOM = 1024),
          (t.CHILDS = 2048),
          (t.INIT = 69905),
          (t.renders = []),
          (t.NORENDER = new t(0, null)),
          t
        );
      })(),
      Context = (function () {
        function t() {
          this._repaint = !1;
        }
        __class(t, "laya.resource.Context");
        var e = t.prototype;
        return (
          (e.replaceReset = function () {
            var e = 0,
              i = 0;
            i = t.replaceKeys.length;
            var n;
            for (e = 0; e < i; e++)
              (n = t.replaceKeys[e]), (this[t.newKeys[e]] = this[n]);
          }),
          (e.replaceResotre = function () {
            this.__restore(), this.__reset();
          }),
          (e.setIsMainContext = function () {}),
          (e.drawTextures = function (t, e, i, n) {
            Stat.drawCall += e.length / 2;
            for (
              var s = t.width, r = t.height, a = 0, o = e.length;
              a < o;
              a += 2
            )
              this.drawTexture(t, e[a], e[a + 1], s, r, i, n);
          }),
          (e.drawCanvas = function (t, e, i, n, s) {
            Stat.drawCall++, this.drawImage(t.source, e, i, n, s);
          }),
          (e.fillRect = function (t, e, i, n, s) {
            Stat.drawCall++,
              s && (this.fillStyle = s),
              this.__fillRect(t, e, i, n);
          }),
          (e.fillText = function (t, e, i, n, s, r) {
            Stat.drawCall++,
              arguments.length > 3 &&
                null != n &&
                ((this.font = n),
                (this.fillStyle = s),
                (this.textAlign = r),
                (this.textBaseline = "top")),
              this.__fillText(t, e, i);
          }),
          (e.fillBorderText = function (t, e, i, n, s, r, a, o) {
            Stat.drawCall++,
              (this.font = n),
              (this.fillStyle = s),
              (this.textBaseline = "top"),
              (this.strokeStyle = r),
              (this.lineWidth = a),
              (this.textAlign = o),
              this.__strokeText(t, e, i),
              this.__fillText(t, e, i);
          }),
          (e.strokeText = function (t, e, i, n, s, r, a) {
            Stat.drawCall++,
              arguments.length > 3 &&
                null != n &&
                ((this.font = n),
                (this.strokeStyle = s),
                (this.lineWidth = r),
                (this.textAlign = a),
                (this.textBaseline = "top")),
              this.__strokeText(t, e, i);
          }),
          (e.transformByMatrix = function (t) {
            this.transform(t.a, t.b, t.c, t.d, t.tx, t.ty);
          }),
          (e.setTransformByMatrix = function (t) {
            this.setTransform(t.a, t.b, t.c, t.d, t.tx, t.ty);
          }),
          (e.clipRect = function (t, e, i, n) {
            Stat.drawCall++,
              this.beginPath(),
              this.rect(t, e, i, n),
              this.clip();
          }),
          (e.drawTexture = function (t, e, i, n, s, r, a) {
            Stat.drawCall++;
            var o = t.uv,
              h = t.bitmap.width,
              l = t.bitmap.height;
            this.drawImage(
              t.source,
              o[0] * h,
              o[1] * l,
              (o[2] - o[0]) * h,
              (o[5] - o[3]) * l,
              e + r,
              i + a,
              n,
              s
            );
          }),
          (e.drawTextureWithTransform = function (t, e, i, n, s, r, a, o, h) {
            Stat.drawCall++;
            var l = t.uv,
              c = t.bitmap.width,
              u = t.bitmap.height;
            this.save(),
              1 != h && (this.globalAlpha *= h),
              r
                ? (this.transform(r.a, r.b, r.c, r.d, r.tx + a, r.ty + o),
                  this.drawImage(
                    t.source,
                    l[0] * c,
                    l[1] * u,
                    (l[2] - l[0]) * c,
                    (l[5] - l[3]) * u,
                    e,
                    i,
                    n,
                    s
                  ))
                : this.drawImage(
                    t.source,
                    l[0] * c,
                    l[1] * u,
                    (l[2] - l[0]) * c,
                    (l[5] - l[3]) * u,
                    e + a,
                    i + o,
                    n,
                    s
                  ),
              this.restore();
          }),
          (e.drawTexture2 = function (t, e, i, n, s, r, a, o) {
            "use strict";
            var h = o[0];
            if (h.loaded && h.bitmap && h.source) {
              Stat.drawCall++;
              var l = 1 !== r;
              if (l) {
                var c = this.globalAlpha;
                this.globalAlpha *= r;
              }
              var u = h.uv,
                _ = h.bitmap.width,
                d = h.bitmap.height;
              s
                ? (this.save(),
                  this.transform(s.a, s.b, s.c, s.d, s.tx + t, s.ty + e),
                  this.drawImage(
                    h.source,
                    u[0] * _,
                    u[1] * d,
                    (u[2] - u[0]) * _,
                    (u[5] - u[3]) * d,
                    o[1] - i,
                    o[2] - n,
                    o[3],
                    o[4]
                  ),
                  this.restore())
                : this.drawImage(
                    h.source,
                    u[0] * _,
                    u[1] * d,
                    (u[2] - u[0]) * _,
                    (u[5] - u[3]) * d,
                    o[1] - i + t,
                    o[2] - n + e,
                    o[3],
                    o[4]
                  ),
                l && (this.globalAlpha = c);
            }
          }),
          (e.fillTexture = function (t, e, i, n, s, r, a, o) {
            if (!o.pat) {
              if (t.uv != Texture.DEF_UV) {
                var h = new HTMLCanvas("2D");
                h.getContext("2d"),
                  h.size(t.width, t.height),
                  h.context.drawTexture(t, 0, 0, t.width, t.height, 0, 0),
                  (t = new Texture(h));
              }
              o.pat = this.createPattern(t.bitmap.source, r);
            }
            var l = e,
              c = i,
              u = 0,
              _ = 0;
            a &&
              ((l += a.x % t.width),
              (c += a.y % t.height),
              (u -= a.x % t.width),
              (_ -= a.y % t.height)),
              this.translate(l, c),
              this.fillRect(u, _, n, s, o.pat),
              this.translate(-l, -c);
          }),
          (e.drawTriangle = function (t, e, i, n, s, r, a, o) {
            var h = t.bitmap,
              l = h.source,
              c = t.width,
              u = t.height,
              _ = h.width,
              d = h.height,
              f = i[n] * _,
              p = i[s] * _,
              g = i[r] * _,
              m = i[n + 1] * d,
              v = i[s + 1] * d,
              y = i[r + 1] * d,
              w = e[n],
              x = e[s],
              T = e[r],
              b = e[n + 1],
              C = e[s + 1],
              M = e[r + 1];
            if (o) {
              var S = (w + x + T) / 3,
                L = (b + C + M) / 3,
                R = w - S,
                P = b - L,
                E = Math.sqrt(R * R + P * P);
              (w = S + (R / E) * (E + 1)),
                (b = L + (P / E) * (E + 1)),
                (P = C - L),
                (x =
                  S + ((R = x - S) / (E = Math.sqrt(R * R + P * P))) * (E + 1)),
                (C = L + (P / E) * (E + 1)),
                (P = M - L),
                (T =
                  S + ((R = T - S) / (E = Math.sqrt(R * R + P * P))) * (E + 1)),
                (M = L + (P / E) * (E + 1));
            }
            this.save(),
              a && this.transform(a.a, a.b, a.c, a.d, a.tx, a.ty),
              this.beginPath(),
              this.moveTo(w, b),
              this.lineTo(x, C),
              this.lineTo(T, M),
              this.closePath(),
              this.clip();
            var A = 1 / (f * v + m * g + p * y - v * g - m * p - f * y),
              I = w * v + m * T + x * y - v * T - m * x - w * y,
              D = f * x + w * g + p * T - x * g - w * p - f * T,
              B =
                f * v * T +
                m * x * g +
                w * p * y -
                w * v * g -
                m * p * T -
                f * x * y,
              F = b * v + m * M + C * y - v * M - m * C - b * y,
              k = f * C + b * g + p * M - C * g - b * p - f * M,
              O =
                f * v * M +
                m * C * g +
                b * p * y -
                b * v * g -
                m * p * M -
                f * C * y;
            this.transform(I * A, F * A, D * A, k * A, B * A, O * A),
              this.drawImage(
                l,
                t.uv[0] * _,
                t.uv[1] * d,
                c,
                u,
                t.uv[0] * _,
                t.uv[1] * d,
                c,
                u
              ),
              this.restore();
          }),
          (e.flush = function () {
            return 0;
          }),
          (e.fillWords = function (t, e, i, n, s, r) {
            n && (this.font = n), s && (this.fillStyle = s);
            (this.textBaseline = "top"), (this.textAlign = "left");
            for (var a = 0, o = t.length; a < o; a++) {
              var h = t[a];
              if ((this.__fillText(h.char, h.x + e, h.y + i), 1 === r)) {
                var l = h.height,
                  c = 0.5 * h.style.letterSpacing;
                c || (c = 0),
                  this.beginPath(),
                  (this.strokeStyle = s),
                  (this.lineWidth = 1),
                  this.moveTo(e + h.x - c + 0.5, i + h.y + l + 0.5),
                  this.lineTo(e + h.x + h.width + c + 0.5, i + h.y + l + 0.5),
                  this.stroke();
              }
            }
          }),
          (e.fillBorderWords = function (t, e, i, n, s, r, a) {
            n && (this.font = n),
              s && (this.fillStyle = s),
              (this.textBaseline = "top"),
              (this.lineWidth = a),
              (this.textAlign = "left"),
              (this.strokeStyle = r);
            for (var o = 0, h = t.length; o < h; o++) {
              var l = t[o];
              this.__strokeText(l.char, l.x + e, l.y + i),
                this.__fillText(l.char, l.x + e, l.y + i);
            }
          }),
          (e.destroy = function () {
            this.canvas.width = this.canvas.height = 0;
          }),
          (e.clear = function () {
            this.clearRect(0, 0, this._canvas.width, this._canvas.height),
              (this._repaint = !1);
          }),
          (e.drawCurves = function (t, e, i) {
            this.beginPath(),
              (this.strokeStyle = i[3]),
              (this.lineWidth = i[4]);
            var n = i[2];
            (t += i[0]), (e += i[1]), this.moveTo(t + n[0], e + n[1]);
            for (var s = 2, r = n.length; s < r; )
              this.quadraticCurveTo(
                t + n[s++],
                e + n[s++],
                t + n[s++],
                e + n[s++]
              );
            this.stroke();
          }),
          (t.__init__ = function (t) {
            var e = laya.resource.Context.prototype;
            if (!(t = t || CanvasRenderingContext2D.prototype).inited) {
              (t.inited = !0),
                (t.__fillText = t.fillText),
                (t.__fillRect = t.fillRect),
                (t.__strokeText = t.strokeText);
              [
                "drawTextures",
                "drawTriangle",
                "fillWords",
                "fillBorderWords",
                "setIsMainContext",
                "fillRect",
                "strokeText",
                "fillTexture",
                "fillText",
                "transformByMatrix",
                "setTransformByMatrix",
                "clipRect",
                "drawTexture",
                "drawTexture2",
                "drawTextureWithTransform",
                "flush",
                "clear",
                "destroy",
                "drawCanvas",
                "fillBorderText",
                "drawCurves",
              ].forEach(function (i) {
                t[i] = e[i];
              });
            }
          }),
          (t.replaceCanvasGetSet = function (t, e) {
            var i = Object.getOwnPropertyDescriptor(t, e);
            if (!i || !i.configurable) return !1;
            var n,
              s = {};
            for (n in i) "set" != n && (s[n] = i[n]);
            var r = i.set;
            return (
              (s.set = function (t) {
                r.call(this, t);
                var e = this.getContext("2d");
                e && "__reset" in e && e.__reset();
              }),
              Object.defineProperty(t, e, s),
              !0
            );
          }),
          (t.replaceGetSet = function (e, i) {
            var n = Object.getOwnPropertyDescriptor(e, i);
            if (!n || !n.configurable) return !1;
            var s,
              r = {};
            for (s in n) "set" != s && (r[s] = n[s]);
            var a = n.set,
              o = "___" + i + "__";
            return (
              t.newKeys.push(o),
              (r.set = function (t) {
                t != this[o] && ((this[o] = t), a.call(this, t));
              }),
              Object.defineProperty(e, i, r),
              !0
            );
          }),
          (t._default = new t()),
          (t.newKeys = []),
          __static(t, [
            "replaceKeys",
            function () {
              return (this.replaceKeys = ["font", "fillStyle", "textBaseline"]);
            },
          ]),
          t
        );
      })(),
      ResourceManager = (function () {
        function t(e) {
          (this._id = 0),
            (this._name = null),
            (this._resources = null),
            (this._memorySize = 0),
            (this._garbageCollectionRate = NaN),
            (this._isOverflow = !1),
            (this.autoRelease = !1),
            (this.autoReleaseMaxSize = 0),
            (this._id = ++t._uniqueIDCounter),
            (this._name = e || "Content Manager"),
            (t._isResourceManagersSorted = !1),
            (this._memorySize = 0),
            (this._isOverflow = !1),
            (this.autoRelease = !1),
            (this.autoReleaseMaxSize = 536870912),
            (this._garbageCollectionRate = 0.2),
            t._resourceManagers.push(this),
            (this._resources = []);
        }
        __class(t, "laya.resource.ResourceManager");
        var e = t.prototype;
        return (
          Laya.imps(e, { "laya.resource.IDispose": !0 }),
          (e.getResourceByIndex = function (t) {
            return this._resources[t];
          }),
          (e.getResourcesLength = function () {
            return this._resources.length;
          }),
          (e.addResource = function (t) {
            t.resourceManager && t.resourceManager.removeResource(t);
            return (
              -1 === this._resources.indexOf(t) &&
              ((t._resourceManager = this),
              this._resources.push(t),
              this.addSize(t.memorySize),
              !0)
            );
          }),
          (e.removeResource = function (t) {
            var e = this._resources.indexOf(t);
            return (
              -1 !== e &&
              (this._resources.splice(e, 1),
              (t._resourceManager = null),
              (this._memorySize -= t.memorySize),
              !0)
            );
          }),
          (e.unload = function () {
            for (
              var t = this._resources.slice(0, this._resources.length), e = 0;
              e < t.length;
              e++
            ) {
              t[e].destroy();
            }
            t.length = 0;
          }),
          (e.dispose = function () {
            if (this === t._systemResourceManager)
              throw new Error("systemResourceManager不能被释放！");
            t._resourceManagers.splice(t._resourceManagers.indexOf(this), 1),
              (t._isResourceManagersSorted = !1);
            for (
              var e = this._resources.slice(0, this._resources.length), i = 0;
              i < e.length;
              i++
            ) {
              var n = e[i];
              n.resourceManager.removeResource(n), n.destroy();
            }
            e.length = 0;
          }),
          (e.addSize = function (t) {
            t &&
              (this.autoRelease &&
                t > 0 &&
                this._memorySize + t > this.autoReleaseMaxSize &&
                this.garbageCollection(
                  (1 - this._garbageCollectionRate) * this.autoReleaseMaxSize
                ),
              (this._memorySize += t));
          }),
          (e.garbageCollection = function (t) {
            var e = this._resources;
            (e = e.slice()).sort(function (t, e) {
              if (!t || !e) throw new Error("a或b不能为空！");
              return t.released && e.released
                ? 0
                : t.released
                ? 1
                : e.released
                ? -1
                : t._lastUseFrameCount - e._lastUseFrameCount;
            });
            for (var i = Stat.loopCount, n = 0, s = e.length; n < s; n++) {
              var r = e[n];
              if (!(i - r._lastUseFrameCount > 1))
                return void (this._memorySize >= t && (this._isOverflow = !0));
              if ((r.releaseResource(), this._memorySize < t))
                return void (this._isOverflow = !1);
            }
          }),
          __getset(0, e, "id", function () {
            return this._id;
          }),
          __getset(
            0,
            e,
            "name",
            function () {
              return this._name;
            },
            function (e) {
              (!e && "" === e) ||
                this._name === e ||
                ((this._name = e), (t._isResourceManagersSorted = !1));
            }
          ),
          __getset(0, e, "memorySize", function () {
            return this._memorySize;
          }),
          __getset(1, t, "systemResourceManager", function () {
            return t._systemResourceManager;
          }),
          (t.__init__ = function () {
            t.currentResourceManager = t.systemResourceManager;
          }),
          (t.getLoadedResourceManagerByIndex = function (e) {
            return t._resourceManagers[e];
          }),
          (t.getLoadedResourceManagersCount = function () {
            return t._resourceManagers.length;
          }),
          (t.recreateContentManagers = function (e) {
            void 0 === e && (e = !1);
            for (
              var i = t.currentResourceManager, n = 0;
              n < t._resourceManagers.length;
              n++
            ) {
              t.currentResourceManager = t._resourceManagers[n];
              for (
                var s = 0;
                s < t.currentResourceManager._resources.length;
                s++
              )
                t.currentResourceManager._resources[s].releaseResource(e),
                  t.currentResourceManager._resources[s].activeResource(e);
            }
            t.currentResourceManager = i;
          }),
          (t.releaseContentManagers = function (e) {
            void 0 === e && (e = !1);
            for (
              var i = t.currentResourceManager, n = 0;
              n < t._resourceManagers.length;
              n++
            ) {
              t.currentResourceManager = t._resourceManagers[n];
              for (
                var s = 0;
                s < t.currentResourceManager._resources.length;
                s++
              ) {
                var r = t.currentResourceManager._resources[s];
                !r.released && r.releaseResource(e);
              }
            }
            t.currentResourceManager = i;
          }),
          (t._uniqueIDCounter = 0),
          (t._isResourceManagersSorted = !1),
          (t._resourceManagers = []),
          __static(t, [
            "_systemResourceManager",
            function () {
              return (this._systemResourceManager = new t(
                "System Resource Manager"
              ));
            },
            "currentResourceManager",
            function () {
              return (this.currentResourceManager = t._systemResourceManager);
            },
          ]),
          t
        );
      })(),
      System = (function () {
        function System() {}
        return (
          __class(System, "laya.system.System"),
          (System.changeDefinition = function (name, classObj) {
            Laya[name] = classObj;
            var str = name + "=classObj";
            eval(str);
          }),
          (System.__init__ = function () {
            Render.isConchApp &&
              (conch.disableConchResManager(),
              conch.disableConchAutoRestoreLostedDevice());
          }),
          System
        );
      })(),
      Browser = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.Browser"),
          __getset(1, t, "pixelRatio", function () {
            return (
              t.__init__(),
              t.userAgent.indexOf(
                "Mozilla/6.0(Linux; Android 6.0; HUAWEI NXT-AL10 Build/HUAWEINXT-AL10)"
              ) > -1
                ? 2
                : RunDriver.getPixelRatio()
            );
          }),
          __getset(1, t, "height", function () {
            return (
              t.__init__(),
              (Laya.stage && Laya.stage.canvasRotation
                ? t.clientWidth
                : t.clientHeight) * t.pixelRatio
            );
          }),
          __getset(1, t, "clientWidth", function () {
            return (
              t.__init__(), t.window.innerWidth || t.document.body.clientWidth
            );
          }),
          __getset(1, t, "window", function () {
            return t.__init__(), t._window;
          }),
          __getset(1, t, "clientHeight", function () {
            return (
              t.__init__(),
              t.window.innerHeight ||
                t.document.body.clientHeight ||
                t.document.documentElement.clientHeight
            );
          }),
          __getset(1, t, "width", function () {
            return (
              t.__init__(),
              (Laya.stage && Laya.stage.canvasRotation
                ? t.clientHeight
                : t.clientWidth) * t.pixelRatio
            );
          }),
          __getset(
            1,
            t,
            "container",
            function () {
              return (
                t.__init__(),
                t._container ||
                  (((t._container = t.createElement("div")).id =
                    "layaContainer"),
                  t.document.body.appendChild(t._container)),
                t._container
              );
            },
            function (e) {
              t._container = e;
            }
          ),
          __getset(1, t, "document", function () {
            return t.__init__(), t._document;
          }),
          (t.__init__ = function () {
            t._window ||
              ((t._window = RunDriver.getWindow()),
              (t._document = t.window.document),
              t._window.addEventListener(
                "message",
                function (t) {
                  laya.utils.Browser._onMessage(t);
                },
                !1
              ),
              (t.document.__createElement = t.document.createElement),
              (window.requestAnimationFrame =
                window.requestAnimationFrame ||
                window.webkitRequestAnimationFrame ||
                window.mozRequestAnimationFrame ||
                window.oRequestAnimationFrame ||
                window.msRequestAnimationFrame ||
                function (t) {
                  return window.setTimeout(t, 1e3 / 60);
                }),
              (t.userAgent = t.window.navigator.userAgent),
              (t.onIOS = !!(t.u = t.userAgent).match(
                /\(i[^;]+;(U;)? CPU.+Mac OS X/
              )),
              (t.onMobile = t.u.indexOf("Mobile") > -1),
              (t.onIPhone = t.u.indexOf("iPhone") > -1),
              (t.onMac = t.u.indexOf("Mac OS X") > -1),
              (t.onIPad = t.u.indexOf("iPad") > -1),
              (t.onAndriod =
                t.u.indexOf("Android") > -1 || t.u.indexOf("Adr") > -1),
              (t.onWP = t.u.indexOf("Windows Phone") > -1),
              (t.onQQBrowser = t.u.indexOf("QQBrowser") > -1),
              (t.onMQQBrowser =
                t.u.indexOf("MQQBrowser") > -1 ||
                (t.u.indexOf("Mobile") > -1 && t.u.indexOf("QQ") > -1)),
              (t.onIE =
                !!t.window.ActiveXObject || "ActiveXObject" in t.window),
              (t.onWeiXin = t.u.indexOf("MicroMessenger") > -1),
              (t.onPC = !t.onMobile),
              (t.onSafari = !!t.u.match(
                /Version\/\d+\.\d\x20Mobile\/\S+\x20Safari/
              )),
              (t.onFirefox = t.u.indexOf("Firefox") > -1),
              (t.onEdge = t.u.indexOf("Edge") > -1),
              (t.onMiniGame = t.u.indexOf("MiniGame") > -1),
              (t.onLimixiu = t.u.indexOf("limixiu") > -1),
              (t.httpProtocol = "http:" == t.window.location.protocol),
              t.onMiniGame &&
                null == t.window.focus &&
                console.error(
                  "请先初始化小游戏适配库，详细教程https://ldc.layabox.com/doc/?nav=zh-ts-5-0-0"
                ),
              (t.webAudioEnabled = !!(
                t.window.AudioContext ||
                t.window.webkitAudioContext ||
                t.window.mozAudioContext
              )),
              (t.soundType = t.webAudioEnabled
                ? "WEBAUDIOSOUND"
                : "AUDIOSOUND"),
              (Sound = t.webAudioEnabled ? WebAudioSound : AudioSound),
              t.webAudioEnabled && WebAudioSound.initWebAudio(),
              AudioSound._initMusicAudio(),
              (t.enableTouch =
                "ontouchstart" in window ||
                (window.DocumentTouch && document instanceof DocumentTouch)),
              window.focus(),
              (SoundManager._soundClass = Sound),
              (Render._mainCanvas =
                Render._mainCanvas || HTMLCanvas.create("2D")),
              t.canvas ||
                ((t.canvas = HTMLCanvas.create("2D")),
                (t.context = t.canvas.getContext("2d"))));
          }),
          (t._onMessage = function (e) {
            if (e.data && "size" == e.data.name) {
              if (
                ((t.window.innerWidth = e.data.width),
                (t.window.innerHeight = e.data.height),
                (t.window.__innerHeight = e.data.clientHeight),
                !t.document.createEvent)
              )
                return void console.warn("no document.createEvent");
              var i = t.document.createEvent("HTMLEvents");
              return (
                i.initEvent("resize", !1, !1), void t.window.dispatchEvent(i)
              );
            }
          }),
          (t.createElement = function (e) {
            return t.__init__(), t.document.__createElement(e);
          }),
          (t.getElementById = function (e) {
            return t.__init__(), t.document.getElementById(e);
          }),
          (t.removeElement = function (t) {
            t && t.parentNode && t.parentNode.removeChild(t);
          }),
          (t.now = function () {
            return RunDriver.now();
          }),
          (t._window = null),
          (t._document = null),
          (t._container = null),
          (t.userAgent = null),
          (t.u = null),
          (t.onIOS = !1),
          (t.onMac = !1),
          (t.onMobile = !1),
          (t.onIPhone = !1),
          (t.onIPad = !1),
          (t.onAndriod = !1),
          (t.onAndroid = !1),
          (t.onWP = !1),
          (t.onQQBrowser = !1),
          (t.onMQQBrowser = !1),
          (t.onSafari = !1),
          (t.onFirefox = !1),
          (t.onEdge = !1),
          (t.onIE = !1),
          (t.onWeiXin = !1),
          (t.onMiniGame = !1),
          (t.onLimixiu = !1),
          (t.onPC = !1),
          (t.httpProtocol = !1),
          (t.webAudioEnabled = !1),
          (t.soundType = null),
          (t.enableTouch = !1),
          (t.canvas = null),
          (t.context = null),
          (t.__init$ = function () {}),
          t
        );
      })(),
      Byte = (function () {
        function t(t) {
          (this._xd_ = !0),
            (this._allocated_ = 8),
            (this._pos_ = 0),
            (this._length = 0),
            t
              ? ((this._u8d_ = new Uint8Array(t)),
                (this._d_ = new DataView(this._u8d_.buffer)),
                (this._length = this._d_.byteLength))
              : this.___resizeBuffer(this._allocated_);
        }
        __class(t, "laya.utils.Byte");
        var e = t.prototype;
        return (
          (e.___resizeBuffer = function (t) {
            try {
              var e = new Uint8Array(t);
              null != this._u8d_ &&
                (this._u8d_.length <= t
                  ? e.set(this._u8d_)
                  : e.set(this._u8d_.subarray(0, t))),
                (this._u8d_ = e),
                (this._d_ = new DataView(e.buffer));
            } catch (e) {
              throw "___resizeBuffer err:" + t;
            }
          }),
          (e.getString = function () {
            return this.rUTF(this.getUint16());
          }),
          (e.getFloat32Array = function (t, e) {
            var i = t + e;
            i = i > this._length ? this._length : i;
            var n = new Float32Array(this._d_.buffer.slice(t, i));
            return (this._pos_ = i), n;
          }),
          (e.getUint8Array = function (t, e) {
            var i = t + e;
            i = i > this._length ? this._length : i;
            var n = new Uint8Array(this._d_.buffer.slice(t, i));
            return (this._pos_ = i), n;
          }),
          (e.getInt16Array = function (t, e) {
            var i = t + e;
            i = i > this._length ? this._length : i;
            var n = new Int16Array(this._d_.buffer.slice(t, i));
            return (this._pos_ = i), n;
          }),
          (e.getFloat32 = function () {
            if (this._pos_ + 4 > this._length)
              throw "getFloat32 error - Out of bounds";
            var t = this._d_.getFloat32(this._pos_, this._xd_);
            return (this._pos_ += 4), t;
          }),
          (e.getFloat64 = function () {
            if (this._pos_ + 8 > this._length)
              throw "getFloat64 error - Out of bounds";
            var t = this._d_.getFloat64(this._pos_, this._xd_);
            return (this._pos_ += 8), t;
          }),
          (e.writeFloat32 = function (t) {
            this.ensureWrite(this._pos_ + 4),
              this._d_.setFloat32(this._pos_, t, this._xd_),
              (this._pos_ += 4);
          }),
          (e.writeFloat64 = function (t) {
            this.ensureWrite(this._pos_ + 8),
              this._d_.setFloat64(this._pos_, t, this._xd_),
              (this._pos_ += 8);
          }),
          (e.getInt32 = function () {
            if (this._pos_ + 4 > this._length)
              throw "getInt32 error - Out of bounds";
            var t = this._d_.getInt32(this._pos_, this._xd_);
            return (this._pos_ += 4), t;
          }),
          (e.getUint32 = function () {
            if (this._pos_ + 4 > this._length)
              throw "getUint32 error - Out of bounds";
            var t = this._d_.getUint32(this._pos_, this._xd_);
            return (this._pos_ += 4), t;
          }),
          (e.writeInt32 = function (t) {
            this.ensureWrite(this._pos_ + 4),
              this._d_.setInt32(this._pos_, t, this._xd_),
              (this._pos_ += 4);
          }),
          (e.writeUint32 = function (t) {
            this.ensureWrite(this._pos_ + 4),
              this._d_.setUint32(this._pos_, t, this._xd_),
              (this._pos_ += 4);
          }),
          (e.getInt16 = function () {
            if (this._pos_ + 2 > this._length)
              throw "getInt16 error - Out of bounds";
            var t = this._d_.getInt16(this._pos_, this._xd_);
            return (this._pos_ += 2), t;
          }),
          (e.getUint16 = function () {
            if (this._pos_ + 2 > this._length)
              throw "getUint16 error - Out of bounds";
            var t = this._d_.getUint16(this._pos_, this._xd_);
            return (this._pos_ += 2), t;
          }),
          (e.writeUint16 = function (t) {
            this.ensureWrite(this._pos_ + 2),
              this._d_.setUint16(this._pos_, t, this._xd_),
              (this._pos_ += 2);
          }),
          (e.writeInt16 = function (t) {
            this.ensureWrite(this._pos_ + 2),
              this._d_.setInt16(this._pos_, t, this._xd_),
              (this._pos_ += 2);
          }),
          (e.getUint8 = function () {
            if (this._pos_ + 1 > this._length)
              throw "getUint8 error - Out of bounds";
            return this._d_.getUint8(this._pos_++);
          }),
          (e.writeUint8 = function (t) {
            this.ensureWrite(this._pos_ + 1),
              this._d_.setUint8(this._pos_, t),
              this._pos_++;
          }),
          (e._getUInt8 = function (t) {
            return this._d_.getUint8(t);
          }),
          (e._getUint16 = function (t) {
            return this._d_.getUint16(t, this._xd_);
          }),
          (e._getMatrix = function () {
            return new Matrix(
              this.getFloat32(),
              this.getFloat32(),
              this.getFloat32(),
              this.getFloat32(),
              this.getFloat32(),
              this.getFloat32()
            );
          }),
          (e.rUTF = function (t) {
            for (
              var e = "",
                i = this._pos_ + t,
                n = 0,
                s = String.fromCharCode,
                r = this._u8d_;
              this._pos_ < i;

            )
              (n = r[this._pos_++]) < 128
                ? 0 != n && (e += s(n))
                : (e += s(
                    n < 224
                      ? ((63 & n) << 6) | (127 & r[this._pos_++])
                      : n < 240
                      ? ((31 & n) << 12) |
                        ((127 & r[this._pos_++]) << 6) |
                        (127 & r[this._pos_++])
                      : ((15 & n) << 18) |
                        ((127 & r[this._pos_++]) << 12) |
                        ((r[this._pos_++] << 6) & 127) |
                        (127 & r[this._pos_++])
                  )),
                0;
            return e;
          }),
          (e.getCustomString = function (t) {
            for (
              var e = "", i = 0, n = 0, s = String.fromCharCode, r = this._u8d_;
              t > 0;

            )
              if ((n = r[this._pos_]) < 128) (e += s(n)), this._pos_++, t--;
              else
                for (i = n - 128, this._pos_++, t -= i; i > 0; )
                  (n = r[this._pos_++]),
                    (e += s((r[this._pos_++] << 8) | n)),
                    i--;
            return e;
          }),
          (e.clear = function () {
            (this._pos_ = 0), (this.length = 0);
          }),
          (e.__getBuffer = function () {
            return this._d_.buffer;
          }),
          (e.writeUTFBytes = function (t) {
            for (var e = 0, i = (t += "").length; e < i; e++) {
              var n = t.charCodeAt(e);
              n <= 127
                ? this.writeByte(n)
                : n <= 2047
                ? (this.ensureWrite(this._pos_ + 2),
                  this._u8d_.set([192 | (n >> 6), 128 | (63 & n)], this._pos_),
                  (this._pos_ += 2))
                : n <= 65535
                ? (this.ensureWrite(this._pos_ + 3),
                  this._u8d_.set(
                    [224 | (n >> 12), 128 | ((n >> 6) & 63), 128 | (63 & n)],
                    this._pos_
                  ),
                  (this._pos_ += 3))
                : (this.ensureWrite(this._pos_ + 4),
                  this._u8d_.set(
                    [
                      240 | (n >> 18),
                      128 | ((n >> 12) & 63),
                      128 | ((n >> 6) & 63),
                      128 | (63 & n),
                    ],
                    this._pos_
                  ),
                  (this._pos_ += 4));
            }
          }),
          (e.writeUTFString = function (t) {
            var e = this.pos;
            this.writeUint16(1), this.writeUTFBytes(t);
            var i = this.pos - e - 2;
            if (i >= 65536) throw "writeUTFString byte len more than 65536";
            this._d_.setUint16(e, i, this._xd_);
          }),
          (e.readUTFString = function () {
            return this.readUTFBytes(this.getUint16());
          }),
          (e.getUTFString = function () {
            return this.readUTFString();
          }),
          (e.readUTFBytes = function (t) {
            if ((void 0 === t && (t = -1), 0 == t)) return "";
            var e = this.bytesAvailable;
            if (t > e) throw "readUTFBytes error - Out of bounds";
            return (t = t > 0 ? t : e), this.rUTF(t);
          }),
          (e.getUTFBytes = function (t) {
            return void 0 === t && (t = -1), this.readUTFBytes(t);
          }),
          (e.writeByte = function (t) {
            this.ensureWrite(this._pos_ + 1),
              this._d_.setInt8(this._pos_, t),
              (this._pos_ += 1);
          }),
          (e.readByte = function () {
            if (this._pos_ + 1 > this._length)
              throw "readByte error - Out of bounds";
            return this._d_.getInt8(this._pos_++);
          }),
          (e.getByte = function () {
            return this.readByte();
          }),
          (e.ensureWrite = function (t) {
            this._length < t && (this._length = t),
              this._allocated_ < t && (this.length = t);
          }),
          (e.writeArrayBuffer = function (t, e, i) {
            if (
              (void 0 === e && (e = 0), void 0 === i && (i = 0), e < 0 || i < 0)
            )
              throw "writeArrayBuffer error - Out of bounds";
            0 == i && (i = t.byteLength - e), this.ensureWrite(this._pos_ + i);
            var n = new Uint8Array(t);
            this._u8d_.set(n.subarray(e, e + i), this._pos_), (this._pos_ += i);
          }),
          __getset(0, e, "buffer", function () {
            var t = this._d_.buffer;
            return t.byteLength == this.length ? t : t.slice(0, this.length);
          }),
          __getset(
            0,
            e,
            "endian",
            function () {
              return this._xd_ ? "littleEndian" : "bigEndian";
            },
            function (t) {
              this._xd_ = "littleEndian" == t;
            }
          ),
          __getset(
            0,
            e,
            "length",
            function () {
              return this._length;
            },
            function (t) {
              this._allocated_ < t
                ? this.___resizeBuffer(
                    (this._allocated_ = Math.floor(
                      Math.max(t, 2 * this._allocated_)
                    ))
                  )
                : this._allocated_ > t &&
                  this.___resizeBuffer((this._allocated_ = t)),
                (this._length = t);
            }
          ),
          __getset(
            0,
            e,
            "pos",
            function () {
              return this._pos_;
            },
            function (t) {
              this._pos_ = t;
            }
          ),
          __getset(0, e, "bytesAvailable", function () {
            return this._length - this._pos_;
          }),
          (t.getSystemEndian = function () {
            if (!t._sysEndian) {
              var e = new ArrayBuffer(2);
              new DataView(e).setInt16(0, 256, !0),
                (t._sysEndian =
                  256 === new Int16Array(e)[0] ? "littleEndian" : "bigEndian");
            }
            return t._sysEndian;
          }),
          (t.BIG_ENDIAN = "bigEndian"),
          (t.LITTLE_ENDIAN = "littleEndian"),
          (t._sysEndian = null),
          t
        );
      })(),
      CacheManager = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.CacheManager"),
          (t.regCacheByFunction = function (e, i) {
            t.unRegCacheByFunction(e, i);
            var n;
            (n = { tryDispose: e, getCacheList: i }), t._cacheList.push(n);
          }),
          (t.unRegCacheByFunction = function (e, i) {
            var n = 0,
              s = 0;
            for (s = t._cacheList.length, n = 0; n < s; n++)
              if (
                t._cacheList[n].tryDispose == e &&
                t._cacheList[n].getCacheList == i
              )
                return void t._cacheList.splice(n, 1);
          }),
          (t.forceDispose = function () {
            var e = 0,
              i = t._cacheList.length;
            for (e = 0; e < i; e++) t._cacheList[e].tryDispose(!0);
          }),
          (t.beginCheck = function (e) {
            void 0 === e && (e = 15e3), Laya.timer.loop(e, null, t._checkLoop);
          }),
          (t.stopCheck = function () {
            Laya.timer.clear(null, t._checkLoop);
          }),
          (t._checkLoop = function () {
            var e = t._cacheList;
            if (!(e.length < 1)) {
              var i = Browser.now(),
                n = 0,
                s = 0;
              for (
                s = n = e.length;
                n > 0 &&
                (t._index++,
                (t._index = t._index % s),
                e[t._index].tryDispose(!1),
                !(Browser.now() - i > t.loopTimeLimit));

              )
                n--;
            }
          }),
          (t.loopTimeLimit = 2),
          (t._cacheList = []),
          (t._index = 0),
          t
        );
      })(),
      ClassUtils = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.ClassUtils"),
          (t.regClass = function (e, i) {
            t._classMap[e] = i;
          }),
          (t.getRegClass = function (e) {
            return t._classMap[e];
          }),
          (t.getInstance = function (e) {
            var i = t.getClass(e);
            return i
              ? new i()
              : (console.warn("[error] Undefined class:", e), null);
          }),
          (t.createByJson = function (e, i, n, s, r) {
            "string" == typeof e && (e = JSON.parse(e));
            var a = e.props;
            if (
              !i &&
              !(i = r ? r.runWith(e) : t.getInstance(a.runtime || e.type))
            )
              return null;
            var o = e.child;
            if (o)
              for (var h = 0, l = o.length; h < l; h++) {
                var c = o[h];
                if (
                  ("render" !== c.props.name &&
                    "render" !== c.props.renderType) ||
                  !i._$set_itemRender
                )
                  if ("Graphic" == c.type) t.addGraphicsToSprite(c, i);
                  else if (t.isDrawType(c.type)) t.addGraphicToSprite(c, i, !0);
                  else {
                    var u = t.createByJson(c, null, n, s, r);
                    "Script" == c.type
                      ? u.hasOwnProperty("owner")
                        ? (u.owner = i)
                        : u.hasOwnProperty("target") && (u.target = i)
                      : "mask" == c.props.renderType
                      ? (i.mask = u)
                      : i.addChild(u);
                  }
                else i.itemRender = c;
              }
            if (a)
              for (var _ in a) {
                var d = a[_];
                "var" === _ && n
                  ? (n[d] = i)
                  : d instanceof Array && "function" == typeof i[_]
                  ? i[_].apply(i, d)
                  : (i[_] = d);
              }
            return (
              s && e.customProps && s.runWith([i, e]),
              i.created && i.created(),
              i
            );
          }),
          (t.addGraphicsToSprite = function (e, i) {
            var n;
            if ((n = e.child) && !(n.length < 1)) {
              var s;
              s = t._getGraphicsFromSprite(e, i);
              var r = 0,
                a = 0;
              e.props &&
                ((r = t._getObjVar(e.props, "x", 0)),
                (a = t._getObjVar(e.props, "y", 0))),
                0 != r && 0 != a && s.translate(r, a);
              var o = 0,
                h = 0;
              for (h = n.length, o = 0; o < h; o++)
                t._addGraphicToGraphics(n[o], s);
              0 != r && 0 != a && s.translate(-r, -a);
            }
          }),
          (t.addGraphicToSprite = function (e, i, n) {
            void 0 === n && (n = !1);
            var s;
            (s = n ? t._getGraphicsFromSprite(e, i) : i.graphics),
              t._addGraphicToGraphics(e, s);
          }),
          (t._getGraphicsFromSprite = function (t, e) {
            var i;
            if (!t || !t.props) return e.graphics;
            var n;
            switch ((n = t.props.renderType)) {
              case "hit":
              case "unHit":
                var s;
                e.hitArea || (e.hitArea = new HitArea()),
                  (s = e.hitArea)[n] || (s[n] = new Graphics()),
                  (i = s[n]);
            }
            return i || (i = e.graphics), i;
          }),
          (t._getTransformData = function (e) {
            var i;
            (e.hasOwnProperty("pivotX") || e.hasOwnProperty("pivotY")) &&
              (i = i || new Matrix()).translate(
                -t._getObjVar(e, "pivotX", 0),
                -t._getObjVar(e, "pivotY", 0)
              );
            var n = t._getObjVar(e, "scaleX", 1),
              s = t._getObjVar(e, "scaleY", 1),
              r = t._getObjVar(e, "rotation", 0);
            t._getObjVar(e, "skewX", 0), t._getObjVar(e, "skewY", 0);
            return (
              (1 == n && 1 == s && 0 == r) ||
                ((i = i || new Matrix()).scale(n, s),
                i.rotate(0.0174532922222222 * r)),
              i
            );
          }),
          (t._addGraphicToGraphics = function (e, i) {
            var n;
            if ((n = e.props)) {
              var s;
              if ((s = t.DrawTypeDic[e.type])) {
                var r;
                r = i;
                var a,
                  o = t._getParams(n, s[1], s[2], s[3]);
                ((a = t._tM) || 1 != t._alpha) &&
                  (r.save(),
                  a && r.transform(a),
                  1 != t._alpha && r.alpha(t._alpha)),
                  r[s[0]].apply(r, o),
                  (a || 1 != t._alpha) && r.restore();
              }
            }
          }),
          (t._adptLineData = function (t) {
            return (
              (t[2] = parseFloat(t[0]) + parseFloat(t[2])),
              (t[3] = parseFloat(t[1]) + parseFloat(t[3])),
              t
            );
          }),
          (t._adptTextureData = function (t) {
            return (t[0] = Loader.getRes(t[0])), t;
          }),
          (t._adptLinesData = function (e) {
            return (e[2] = t._getPointListByStr(e[2])), e;
          }),
          (t.isDrawType = function (e) {
            return "Image" != e && t.DrawTypeDic.hasOwnProperty(e);
          }),
          (t._getParams = function (e, i, n, s) {
            void 0 === n && (n = 0);
            var r;
            (r = t._temParam).length = i.length;
            var a = 0,
              o = 0;
            for (o = i.length, a = 0; a < o; a++)
              r[a] = t._getObjVar(e, i[a][0], i[a][1]);
            t._alpha = t._getObjVar(e, "alpha", 1);
            var h;
            return (
              (h = t._getTransformData(e))
                ? (n || (n = 0),
                  h.translate(r[n], r[n + 1]),
                  (r[n] = r[n + 1] = 0),
                  (t._tM = h))
                : (t._tM = null),
              s && t[s] && (r = t[s](r)),
              r
            );
          }),
          (t._getPointListByStr = function (t) {
            var e,
              i = 0,
              n = 0;
            for (n = (e = t.split(",")).length, i = 0; i < n; i++)
              e[i] = parseFloat(e[i]);
            return e;
          }),
          (t._getObjVar = function (t, e, i) {
            return t.hasOwnProperty(e) ? t[e] : i;
          }),
          (t._temParam = []),
          (t._classMap = {
            Sprite: "laya.display.Sprite",
            Text: "laya.display.Text",
            Animation: "laya.display.Animation",
            Skeleton: "laya.ani.bone.Skeleton",
            Particle2D: "laya.particle.Particle2D",
            div: "laya.html.dom.HTMLDivElement",
            p: "laya.html.dom.HTMLElement",
            img: "laya.html.dom.HTMLImageElement",
            span: "laya.html.dom.HTMLElement",
            br: "laya.html.dom.HTMLBrElement",
            style: "laya.html.dom.HTMLStyleElement",
            font: "laya.html.dom.HTMLElement",
            a: "laya.html.dom.HTMLElement",
            "#text": "laya.html.dom.HTMLElement",
          }),
          (t.getClass = function (e) {
            var i = t._classMap[e] || e;
            return "string" == typeof i ? Laya.__classmap[i] : i;
          }),
          (t._tM = null),
          (t._alpha = NaN),
          __static(t, [
            "DrawTypeDic",
            function () {
              return (this.DrawTypeDic = {
                Rect: [
                  "drawRect",
                  [
                    ["x", 0],
                    ["y", 0],
                    ["width", 0],
                    ["height", 0],
                    ["fillColor", null],
                    ["lineColor", null],
                    ["lineWidth", 1],
                  ],
                ],
                Circle: [
                  "drawCircle",
                  [
                    ["x", 0],
                    ["y", 0],
                    ["radius", 0],
                    ["fillColor", null],
                    ["lineColor", null],
                    ["lineWidth", 1],
                  ],
                ],
                Pie: [
                  "drawPie",
                  [
                    ["x", 0],
                    ["y", 0],
                    ["radius", 0],
                    ["startAngle", 0],
                    ["endAngle", 0],
                    ["fillColor", null],
                    ["lineColor", null],
                    ["lineWidth", 1],
                  ],
                ],
                Image: [
                  "drawTexture",
                  [
                    ["x", 0],
                    ["y", 0],
                    ["width", 0],
                    ["height", 0],
                  ],
                ],
                Texture: [
                  "drawTexture",
                  [
                    ["skin", null],
                    ["x", 0],
                    ["y", 0],
                    ["width", 0],
                    ["height", 0],
                  ],
                  1,
                  "_adptTextureData",
                ],
                FillTexture: [
                  "fillTexture",
                  [
                    ["skin", null],
                    ["x", 0],
                    ["y", 0],
                    ["width", 0],
                    ["height", 0],
                    ["repeat", null],
                  ],
                  1,
                  "_adptTextureData",
                ],
                FillText: [
                  "fillText",
                  [
                    ["text", ""],
                    ["x", 0],
                    ["y", 0],
                    ["font", null],
                    ["color", null],
                    ["textAlign", null],
                  ],
                  1,
                ],
                Line: [
                  "drawLine",
                  [
                    ["x", 0],
                    ["y", 0],
                    ["toX", 0],
                    ["toY", 0],
                    ["lineColor", null],
                    ["lineWidth", 0],
                  ],
                  0,
                  "_adptLineData",
                ],
                Lines: [
                  "drawLines",
                  [
                    ["x", 0],
                    ["y", 0],
                    ["points", ""],
                    ["lineColor", null],
                    ["lineWidth", 0],
                  ],
                  0,
                  "_adptLinesData",
                ],
                Curves: [
                  "drawCurves",
                  [
                    ["x", 0],
                    ["y", 0],
                    ["points", ""],
                    ["lineColor", null],
                    ["lineWidth", 0],
                  ],
                  0,
                  "_adptLinesData",
                ],
                Poly: [
                  "drawPoly",
                  [
                    ["x", 0],
                    ["y", 0],
                    ["points", ""],
                    ["fillColor", null],
                    ["lineColor", null],
                    ["lineWidth", 1],
                  ],
                  0,
                  "_adptLinesData",
                ],
              });
            },
          ]),
          t
        );
      })(),
      Color = (function () {
        function t(e) {
          if (((this._color = []), "string" == typeof e)) {
            (this.strColor = e),
              null === e && (e = "#000000"),
              "#" == e.charAt(0) && (e = e.substr(1));
            var i = e.length;
            if (3 == i || 4 == i) {
              for (var n = "", s = 0; s < i; s++) n += e[s] + e[s];
              e = n;
            }
            var r = (this.numColor = parseInt(e, 16));
            if (8 == e.length)
              return void (this._color = [
                parseInt(e.substr(0, 2), 16) / 255,
                ((16711680 & r) >> 16) / 255,
                ((65280 & r) >> 8) / 255,
                (255 & r) / 255,
              ]);
          } else (r = this.numColor = e), (this.strColor = Utils.toHexColor(r));
          (this._color = [
            ((16711680 & r) >> 16) / 255,
            ((65280 & r) >> 8) / 255,
            (255 & r) / 255,
            1,
          ]),
            (this._color.__id = ++t._COLODID);
        }
        return (
          __class(t, "laya.utils.Color"),
          (t._initDefault = function () {
            t._DEFAULT = {};
            for (var e in t._COLOR_MAP)
              t._SAVE[e] = t._DEFAULT[e] = new t(t._COLOR_MAP[e]);
            return t._DEFAULT;
          }),
          (t._initSaveMap = function () {
            (t._SAVE_SIZE = 0), (t._SAVE = {});
            for (var e in t._DEFAULT) t._SAVE[e] = t._DEFAULT[e];
          }),
          (t.create = function (e) {
            var i = t._SAVE[e + ""];
            return null != i
              ? i
              : (t._SAVE_SIZE < 1e3 || t._initSaveMap(),
                (t._SAVE[e + ""] = new t(e)));
          }),
          (t._SAVE = {}),
          (t._SAVE_SIZE = 0),
          (t._COLOR_MAP = {
            white: "#FFFFFF",
            red: "#FF0000",
            green: "#00FF00",
            blue: "#0000FF",
            black: "#000000",
            yellow: "#FFFF00",
            gray: "#AAAAAA",
          }),
          (t._DEFAULT = t._initDefault()),
          (t._COLODID = 1),
          t
        );
      })(),
      Dictionary = (function () {
        function t() {
          (this._values = []), (this._keys = []);
        }
        __class(t, "laya.utils.Dictionary");
        var e = t.prototype;
        return (
          (e.set = function (t, e) {
            var i = this.indexOf(t);
            i >= 0
              ? (this._values[i] = e)
              : (this._keys.push(t), this._values.push(e));
          }),
          (e.indexOf = function (t) {
            var e = this._keys.indexOf(t);
            return e >= 0
              ? e
              : ((t =
                  "string" == typeof t
                    ? Number(t)
                    : "number" == typeof t
                    ? t.toString()
                    : t),
                this._keys.indexOf(t));
          }),
          (e.get = function (t) {
            var e = this.indexOf(t);
            return e < 0 ? null : this._values[e];
          }),
          (e.remove = function (t) {
            var e = this.indexOf(t);
            return (
              e >= 0 && (this._keys.splice(e, 1), this._values.splice(e, 1), !0)
            );
          }),
          (e.clear = function () {
            (this._values.length = 0), (this._keys.length = 0);
          }),
          __getset(0, e, "values", function () {
            return this._values;
          }),
          __getset(0, e, "keys", function () {
            return this._keys;
          }),
          t
        );
      })(),
      Dragging = (function () {
        function t() {
          (this.ratio = 0.92),
            (this.maxOffset = 60),
            (this._dragging = !1),
            (this._clickOnly = !0);
        }
        __class(t, "laya.utils.Dragging");
        var e = t.prototype;
        return (
          (e.start = function (t, e, i, n, s, r, a, o) {
            void 0 === o && (o = 0.92),
              this.clearTimer(),
              (this.target = t),
              (this.area = e),
              (this.hasInertia = i),
              (this.elasticDistance = e ? n : 0),
              (this.elasticBackTime = s),
              (this.data = r),
              (this._disableMouseEvent = a),
              (this.ratio = o),
              1 != t.globalScaleX || 1 != t.globalScaleY
                ? (this._parent = t.parent)
                : (this._parent = Laya.stage),
              (this._clickOnly = !0),
              (this._dragging = !0),
              (this._elasticRateX = this._elasticRateY = 1),
              (this._lastX = this._parent.mouseX),
              (this._lastY = this._parent.mouseY),
              Laya.stage.on("mouseup", this, this.onStageMouseUp),
              Laya.stage.on("mouseout", this, this.onStageMouseUp),
              Laya.timer.frameLoop(1, this, this.loop);
          }),
          (e.clearTimer = function () {
            Laya.timer.clear(this, this.loop),
              Laya.timer.clear(this, this.tweenMove),
              this._tween && (this._tween.recover(), (this._tween = null));
          }),
          (e.stop = function () {
            this._dragging &&
              ((MouseManager.instance.disableMouseEvent = !1),
              Laya.stage.off("mouseup", this, this.onStageMouseUp),
              Laya.stage.off("mouseout", this, this.onStageMouseUp),
              (this._dragging = !1),
              this.target && this.area && this.backToArea(),
              this.clear());
          }),
          (e.loop = function () {
            var t = this._parent.getMousePoint(),
              e = t.x,
              i = t.y,
              n = e - this._lastX,
              s = i - this._lastY;
            if (this._clickOnly) {
              if (
                !(
                  Math.abs(n * Laya.stage._canvasTransform.getScaleX()) > 1 ||
                  Math.abs(s * Laya.stage._canvasTransform.getScaleY()) > 1
                )
              )
                return;
              (this._clickOnly = !1),
                this._offsets || (this._offsets = []),
                (this._offsets.length = 0),
                this.target.event("dragstart", this.data),
                (MouseManager.instance.disableMouseEvent =
                  this._disableMouseEvent),
                this.target._set$P("$_MOUSEDOWN", !1);
            } else this._offsets.push(n, s);
            (0 === n && 0 === s) ||
              ((this._lastX = e),
              (this._lastY = i),
              (this.target.x += n * this._elasticRateX),
              (this.target.y += s * this._elasticRateY),
              this.area && this.checkArea(),
              this.target.event("dragmove", this.data));
          }),
          (e.checkArea = function () {
            if (this.elasticDistance <= 0) this.backToArea();
            else {
              if (this.target.x < this.area.x)
                var t = this.area.x - this.target.x;
              else
                t =
                  this.target.x > this.area.x + this.area.width
                    ? this.target.x - this.area.x - this.area.width
                    : 0;
              if (
                ((this._elasticRateX = Math.max(
                  0,
                  1 - t / this.elasticDistance
                )),
                this.target.y < this.area.y)
              )
                var e = this.area.y - this.target.y;
              else
                e =
                  this.target.y > this.area.y + this.area.height
                    ? this.target.y - this.area.y - this.area.height
                    : 0;
              this._elasticRateY = Math.max(0, 1 - e / this.elasticDistance);
            }
          }),
          (e.backToArea = function () {
            (this.target.x = Math.min(
              Math.max(this.target.x, this.area.x),
              this.area.x + this.area.width
            )),
              (this.target.y = Math.min(
                Math.max(this.target.y, this.area.y),
                this.area.y + this.area.height
              ));
          }),
          (e.onStageMouseUp = function (t) {
            if (
              ((MouseManager.instance.disableMouseEvent = !1),
              Laya.stage.off("mouseup", this, this.onStageMouseUp),
              Laya.stage.off("mouseout", this, this.onStageMouseUp),
              Laya.timer.clear(this, this.loop),
              !this._clickOnly && this.target)
            )
              if (this.hasInertia) {
                this._offsets.length < 1 &&
                  this._offsets.push(
                    this._parent.mouseX - this._lastX,
                    this._parent.mouseY - this._lastY
                  ),
                  (this._offsetX = this._offsetY = 0);
                for (
                  var e = this._offsets.length,
                    i = Math.min(e, 6),
                    n = this._offsets.length - i,
                    s = e - 1;
                  s > n;
                  s--
                )
                  (this._offsetY += this._offsets[s--]),
                    (this._offsetX += this._offsets[s]);
                (this._offsetX = (this._offsetX / i) * 2),
                  (this._offsetY = (this._offsetY / i) * 2),
                  Math.abs(this._offsetX) > this.maxOffset &&
                    (this._offsetX =
                      this._offsetX > 0 ? this.maxOffset : -this.maxOffset),
                  Math.abs(this._offsetY) > this.maxOffset &&
                    (this._offsetY =
                      this._offsetY > 0 ? this.maxOffset : -this.maxOffset),
                  Laya.timer.frameLoop(1, this, this.tweenMove);
              } else
                this.elasticDistance > 0 ? this.checkElastic() : this.clear();
          }),
          (e.checkElastic = function () {
            var t = NaN,
              e = NaN;
            if (
              (this.target.x < this.area.x
                ? (t = this.area.x)
                : this.target.x > this.area.x + this.area.width &&
                  (t = this.area.x + this.area.width),
              this.target.y < this.area.y
                ? (e = this.area.y)
                : this.target.y > this.area.y + this.area.height &&
                  (e = this.area.y + this.area.height),
              isNaN(t) && isNaN(e))
            )
              this.clear();
            else {
              var i = {};
              isNaN(t) || (i.x = t),
                isNaN(e) || (i.y = e),
                (this._tween = Tween.to(
                  this.target,
                  i,
                  this.elasticBackTime,
                  Ease.sineOut,
                  Handler.create(this, this.clear),
                  0,
                  !1,
                  !1
                ));
            }
          }),
          (e.tweenMove = function () {
            (this._offsetX *= this.ratio * this._elasticRateX),
              (this._offsetY *= this.ratio * this._elasticRateY),
              (this.target.x += this._offsetX),
              (this.target.y += this._offsetY),
              this.area && this.checkArea(),
              this.target.event("dragmove", this.data),
              ((Math.abs(this._offsetX) < 1 && Math.abs(this._offsetY) < 1) ||
                this._elasticRateX < 0.5 ||
                this._elasticRateY < 0.5) &&
                (Laya.timer.clear(this, this.tweenMove),
                this.elasticDistance > 0 ? this.checkElastic() : this.clear());
          }),
          (e.clear = function () {
            if (this.target) {
              this.clearTimer();
              var t = this.target;
              (this.target = null),
                (this._parent = null),
                t.event("dragend", this.data);
            }
          }),
          t
        );
      })(),
      Ease = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.Ease"),
          (t.linearNone = function (t, e, i, n) {
            return (i * t) / n + e;
          }),
          (t.linearIn = function (t, e, i, n) {
            return (i * t) / n + e;
          }),
          (t.linearInOut = function (t, e, i, n) {
            return (i * t) / n + e;
          }),
          (t.linearOut = function (t, e, i, n) {
            return (i * t) / n + e;
          }),
          (t.bounceIn = function (e, i, n, s) {
            return n - t.bounceOut(s - e, 0, n, s) + i;
          }),
          (t.bounceInOut = function (e, i, n, s) {
            return e < 0.5 * s
              ? 0.5 * t.bounceIn(2 * e, 0, n, s) + i
              : 0.5 * t.bounceOut(2 * e - s, 0, n, s) + 0.5 * n + i;
          }),
          (t.bounceOut = function (t, e, i, n) {
            return (t /= n) < 1 / 2.75
              ? i * (7.5625 * t * t) + e
              : t < 2 / 2.75
              ? i * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75) + e
              : t < 2.5 / 2.75
              ? i * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375) + e
              : i * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375) + e;
          }),
          (t.backIn = function (t, e, i, n, s) {
            return (
              void 0 === s && (s = 1.70158),
              i * (t /= n) * t * ((s + 1) * t - s) + e
            );
          }),
          (t.backInOut = function (t, e, i, n, s) {
            return (
              void 0 === s && (s = 1.70158),
              (t /= 0.5 * n) < 1
                ? 0.5 * i * (t * t * ((1 + (s *= 1.525)) * t - s)) + e
                : (i / 2) * ((t -= 2) * t * ((1 + (s *= 1.525)) * t + s) + 2) +
                  e
            );
          }),
          (t.backOut = function (t, e, i, n, s) {
            return (
              void 0 === s && (s = 1.70158),
              i * ((t = t / n - 1) * t * ((s + 1) * t + s) + 1) + e
            );
          }),
          (t.elasticIn = function (e, i, n, s, r, a) {
            void 0 === r && (r = 0), void 0 === a && (a = 0);
            var o;
            return 0 == e
              ? i
              : 1 == (e /= s)
              ? i + n
              : (a || (a = 0.3 * s),
                !r || (n > 0 && r < n) || (n < 0 && r < -n)
                  ? ((r = n), (o = a / 4))
                  : (o = (a / t.PI2) * Math.asin(n / r)),
                -r *
                  Math.pow(2, 10 * (e -= 1)) *
                  Math.sin(((e * s - o) * t.PI2) / a) +
                  i);
          }),
          (t.elasticInOut = function (e, i, n, s, r, a) {
            void 0 === r && (r = 0), void 0 === a && (a = 0);
            var o;
            return 0 == e
              ? i
              : 2 == (e /= 0.5 * s)
              ? i + n
              : (a || (a = s * (0.3 * 1.5)),
                !r || (n > 0 && r < n) || (n < 0 && r < -n)
                  ? ((r = n), (o = a / 4))
                  : (o = (a / t.PI2) * Math.asin(n / r)),
                e < 1
                  ? r *
                      Math.pow(2, 10 * (e -= 1)) *
                      Math.sin(((e * s - o) * t.PI2) / a) *
                      -0.5 +
                    i
                  : r *
                      Math.pow(2, -10 * (e -= 1)) *
                      Math.sin(((e * s - o) * t.PI2) / a) *
                      0.5 +
                    n +
                    i);
          }),
          (t.elasticOut = function (e, i, n, s, r, a) {
            void 0 === r && (r = 0), void 0 === a && (a = 0);
            var o;
            return 0 == e
              ? i
              : 1 == (e /= s)
              ? i + n
              : (a || (a = 0.3 * s),
                !r || (n > 0 && r < n) || (n < 0 && r < -n)
                  ? ((r = n), (o = a / 4))
                  : (o = (a / t.PI2) * Math.asin(n / r)),
                r * Math.pow(2, -10 * e) * Math.sin(((e * s - o) * t.PI2) / a) +
                  n +
                  i);
          }),
          (t.strongIn = function (t, e, i, n) {
            return i * (t /= n) * t * t * t * t + e;
          }),
          (t.strongInOut = function (t, e, i, n) {
            return (t /= 0.5 * n) < 1
              ? 0.5 * i * t * t * t * t * t + e
              : 0.5 * i * ((t -= 2) * t * t * t * t + 2) + e;
          }),
          (t.strongOut = function (t, e, i, n) {
            return i * ((t = t / n - 1) * t * t * t * t + 1) + e;
          }),
          (t.sineInOut = function (t, e, i, n) {
            return 0.5 * -i * (Math.cos((Math.PI * t) / n) - 1) + e;
          }),
          (t.sineIn = function (e, i, n, s) {
            return -n * Math.cos((e / s) * t.HALF_PI) + n + i;
          }),
          (t.sineOut = function (e, i, n, s) {
            return n * Math.sin((e / s) * t.HALF_PI) + i;
          }),
          (t.quintIn = function (t, e, i, n) {
            return i * (t /= n) * t * t * t * t + e;
          }),
          (t.quintInOut = function (t, e, i, n) {
            return (t /= 0.5 * n) < 1
              ? 0.5 * i * t * t * t * t * t + e
              : 0.5 * i * ((t -= 2) * t * t * t * t + 2) + e;
          }),
          (t.quintOut = function (t, e, i, n) {
            return i * ((t = t / n - 1) * t * t * t * t + 1) + e;
          }),
          (t.quartIn = function (t, e, i, n) {
            return i * (t /= n) * t * t * t + e;
          }),
          (t.quartInOut = function (t, e, i, n) {
            return (t /= 0.5 * n) < 1
              ? 0.5 * i * t * t * t * t + e
              : 0.5 * -i * ((t -= 2) * t * t * t - 2) + e;
          }),
          (t.quartOut = function (t, e, i, n) {
            return -i * ((t = t / n - 1) * t * t * t - 1) + e;
          }),
          (t.cubicIn = function (t, e, i, n) {
            return i * (t /= n) * t * t + e;
          }),
          (t.cubicInOut = function (t, e, i, n) {
            return (t /= 0.5 * n) < 1
              ? 0.5 * i * t * t * t + e
              : 0.5 * i * ((t -= 2) * t * t + 2) + e;
          }),
          (t.cubicOut = function (t, e, i, n) {
            return i * ((t = t / n - 1) * t * t + 1) + e;
          }),
          (t.quadIn = function (t, e, i, n) {
            return i * (t /= n) * t + e;
          }),
          (t.quadInOut = function (t, e, i, n) {
            return (t /= 0.5 * n) < 1
              ? 0.5 * i * t * t + e
              : 0.5 * -i * (--t * (t - 2) - 1) + e;
          }),
          (t.quadOut = function (t, e, i, n) {
            return -i * (t /= n) * (t - 2) + e;
          }),
          (t.expoIn = function (t, e, i, n) {
            return 0 == t
              ? e
              : i * Math.pow(2, 10 * (t / n - 1)) + e - 0.001 * i;
          }),
          (t.expoInOut = function (t, e, i, n) {
            return 0 == t
              ? e
              : t == n
              ? e + i
              : (t /= 0.5 * n) < 1
              ? 0.5 * i * Math.pow(2, 10 * (t - 1)) + e
              : 0.5 * i * (2 - Math.pow(2, -10 * --t)) + e;
          }),
          (t.expoOut = function (t, e, i, n) {
            return t == n ? e + i : i * (1 - Math.pow(2, (-10 * t) / n)) + e;
          }),
          (t.circIn = function (t, e, i, n) {
            return -i * (Math.sqrt(1 - (t /= n) * t) - 1) + e;
          }),
          (t.circInOut = function (t, e, i, n) {
            return (t /= 0.5 * n) < 1
              ? 0.5 * -i * (Math.sqrt(1 - t * t) - 1) + e
              : 0.5 * i * (Math.sqrt(1 - (t -= 2) * t) + 1) + e;
          }),
          (t.circOut = function (t, e, i, n) {
            return i * Math.sqrt(1 - (t = t / n - 1) * t) + e;
          }),
          (t.HALF_PI = 0.5 * Math.PI),
          (t.PI2 = 2 * Math.PI),
          t
        );
      })(),
      HitArea = (function () {
        function t() {
          (this._hit = null), (this._unHit = null);
        }
        __class(t, "laya.utils.HitArea");
        var e = t.prototype;
        return (
          (e.isHit = function (e, i) {
            return (
              !!t.isHitGraphic(e, i, this.hit) &&
              !t.isHitGraphic(e, i, this.unHit)
            );
          }),
          (e.contains = function (t, e) {
            return this.isHit(t, e);
          }),
          __getset(
            0,
            e,
            "hit",
            function () {
              return this._hit || (this._hit = new Graphics()), this._hit;
            },
            function (t) {
              this._hit = t;
            }
          ),
          __getset(
            0,
            e,
            "unHit",
            function () {
              return this._unHit || (this._unHit = new Graphics()), this._unHit;
            },
            function (t) {
              this._unHit = t;
            }
          ),
          (t.isHitGraphic = function (e, i, n) {
            if (!n) return !1;
            var s;
            if (
              (!(s = n.cmds) &&
                n._one &&
                (((s = t._cmds).length = 1), (s[0] = n._one)),
              !s)
            )
              return !1;
            var r = 0,
              a = 0;
            a = s.length;
            var o;
            for (r = 0; r < a; r++)
              if ((o = s[r])) {
                var h = Render._context;
                switch (o.callee) {
                  case h._translate:
                  case 6:
                    (e -= o[0]), (i -= o[1]);
                }
                if (t.isHitCmd(e, i, o)) return !0;
              }
            return !1;
          }),
          (t.isHitCmd = function (e, i, n) {
            if (!n) return !1;
            var s = Render._context,
              r = !1;
            switch (n.callee) {
              case s._drawRect:
              case 13:
                t._rec.setTo(n[0], n[1], n[2], n[3]),
                  (r = t._rec.contains(e, i));
                break;
              case s._drawCircle:
              case s._fillCircle:
              case 14:
                r = (e -= n[0]) * e + (i -= n[1]) * i < n[2] * n[2];
                break;
              case s._drawPoly:
              case 18:
                (e -= n[0]), (i -= n[1]), (r = t.ptInPolygon(e, i, n[2]));
            }
            return r;
          }),
          (t.ptInPolygon = function (e, i, n) {
            var s;
            (s = t._ptPoint).setTo(e, i);
            var r = 0,
              a = NaN,
              o = NaN,
              h = NaN,
              l = NaN,
              c = 0;
            c = n.length;
            for (var u = 0; u < c; u += 2)
              if (
                ((a = n[u]),
                (o = n[u + 1]),
                (h = n[(u + 2) % c]),
                (l = n[(u + 3) % c]),
                o != l && !(s.y < Math.min(o, l) || s.y >= Math.max(o, l)))
              ) {
                ((s.y - o) * (h - a)) / (l - o) + a > s.x && r++;
              }
            return r % 2 == 1;
          }),
          (t._cmds = []),
          __static(t, [
            "_rec",
            function () {
              return (this._rec = new Rectangle());
            },
            "_ptPoint",
            function () {
              return (this._ptPoint = new Point());
            },
          ]),
          t
        );
      })(),
      HTMLChar = (function () {
        function t(e, i, n, s) {
          (this.char = e),
            (this.charNum = e.charCodeAt(0)),
            (this._x = this._y = 0),
            (this.width = i),
            (this.height = n),
            (this.style = s),
            (this.isWord = !t._isWordRegExp.test(e));
        }
        __class(t, "laya.utils.HTMLChar");
        var e = t.prototype;
        return (
          Laya.imps(e, { "laya.display.ILayout": !0 }),
          (e.setSprite = function (t) {
            this._sprite = t;
          }),
          (e.getSprite = function () {
            return this._sprite;
          }),
          (e._isChar = function () {
            return !0;
          }),
          (e._getCSSStyle = function () {
            return this.style;
          }),
          __getset(
            0,
            e,
            "width",
            function () {
              return this._w;
            },
            function (t) {
              this._w = t;
            }
          ),
          __getset(
            0,
            e,
            "x",
            function () {
              return this._x;
            },
            function (t) {
              this._sprite && (this._sprite.x = t), (this._x = t);
            }
          ),
          __getset(
            0,
            e,
            "y",
            function () {
              return this._y;
            },
            function (t) {
              this._sprite && (this._sprite.y = t), (this._y = t);
            }
          ),
          __getset(
            0,
            e,
            "height",
            function () {
              return this._h;
            },
            function (t) {
              this._h = t;
            }
          ),
          (t._isWordRegExp = new RegExp("[\\w.]", "")),
          t
        );
      })(),
      Log = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.Log"),
          (t.enable = function () {
            t._logdiv ||
              ((t._logdiv = Browser.window.document.createElement("div")),
              Browser.window.document.body.appendChild(t._logdiv),
              (t._logdiv.style.cssText =
                "pointer-events:none;border:white;overflow:hidden;z-index:1000000;background:rgba(100,100,100,0.6);color:white;position: absolute;left:0px;top:0px;width:50%;height:50%;"));
          }),
          (t.toggle = function () {
            var e = t._logdiv.style;
            "1px" == e.width
              ? (e.width = e.height = "50%")
              : (e.width = e.height = "1px");
          }),
          (t.print = function (e) {
            t._logdiv &&
              (t._count >= t.maxCount && t.clear(),
              t._count++,
              (t._logdiv.innerText += e + "\n"),
              (t._logdiv.scrollTop = t._logdiv.scrollHeight));
          }),
          (t.clear = function () {
            (t._logdiv.innerText = ""), (t._count = 0);
          }),
          (t._logdiv = null),
          (t._count = 0),
          (t.maxCount = 20),
          t
        );
      })(),
      Mouse = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.Mouse"),
          __getset(
            1,
            t,
            "cursor",
            function () {
              return t._style.cursor;
            },
            function (e) {
              t._style.cursor = e;
            }
          ),
          (t.hide = function () {
            "none" != t.cursor &&
              ((t._preCursor = t.cursor), (t.cursor = "none"));
          }),
          (t.show = function () {
            "none" == t.cursor &&
              (t.cursor = t._preCursor ? t._preCursor : "auto");
          }),
          (t._preCursor = null),
          __static(t, [
            "_style",
            function () {
              return (this._style = Browser.document.body.style);
            },
          ]),
          t
        );
      })(),
      Pool = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.Pool"),
          (t.getPoolBySign = function (e) {
            return t._poolDic[e] || (t._poolDic[e] = []);
          }),
          (t.clearBySign = function (e) {
            t._poolDic[e] && (t._poolDic[e].length = 0);
          }),
          (t.recover = function (e, i) {
            i.__InPool || ((i.__InPool = !0), t.getPoolBySign(e).push(i));
          }),
          (t.getItemByClass = function (e, i) {
            var n = t.getPoolBySign(e),
              s = n.length ? n.pop() : new i();
            return (s.__InPool = !1), s;
          }),
          (t.getItemByCreateFun = function (e, i) {
            var n = t.getPoolBySign(e),
              s = n.length ? n.pop() : i();
            return (s.__InPool = !1), s;
          }),
          (t.getItem = function (e) {
            var i = t.getPoolBySign(e),
              n = i.length ? i.pop() : null;
            return n && (n.__InPool = !1), n;
          }),
          (t._poolDic = {}),
          (t.InPoolSign = "__InPool"),
          t
        );
      })(),
      PoolCache = (function () {
        function t() {
          (this.sign = null), (this.maxCount = 1e3);
        }
        __class(t, "laya.utils.PoolCache");
        var e = t.prototype;
        return (
          (e.getCacheList = function () {
            return Pool.getPoolBySign(this.sign);
          }),
          (e.tryDispose = function (t) {
            var e;
            (e = Pool.getPoolBySign(this.sign)).length > this.maxCount &&
              e.splice(this.maxCount, e.length - this.maxCount);
          }),
          (t.addPoolCacheManager = function (e, i) {
            void 0 === i && (i = 100);
            var n;
            ((n = new t()).sign = e),
              (n.maxCount = i),
              CacheManager.regCacheByFunction(
                Utils.bind(n.tryDispose, n),
                Utils.bind(n.getCacheList, n)
              );
          }),
          t
        );
      })(),
      Stat = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.Stat"),
          __getset(1, t, "onclick", null, function (e) {
            t._sp && t._sp.on("click", t._sp, e),
              t._canvas &&
                ((t._canvas.source.onclick = e),
                (t._canvas.source.style.pointerEvents = ""));
          }),
          (t.show = function (e, i) {
            void 0 === e && (e = 0),
              void 0 === i && (i = 0),
              Render.isConchApp
                ? Browser.window.conch.showFPS &&
                  Browser.window.conch.showFPS(e, i)
                : (Browser.onMiniGame ||
                    Browser.onLimixiu ||
                    (t._useCanvas = !0),
                  (t._show = !0),
                  (t._fpsData.length = 60),
                  (t._view[0] = {
                    title: "FPS(Canvas)",
                    value: "_fpsStr",
                    color: "yellow",
                    units: "int",
                  }),
                  (t._view[1] = {
                    title: "Sprite",
                    value: "_spriteStr",
                    color: "white",
                    units: "int",
                  }),
                  (t._view[2] = {
                    title: "DrawCall",
                    value: "drawCall",
                    color: "white",
                    units: "int",
                  }),
                  (t._view[3] = {
                    title: "CurMem",
                    value: "currentMemorySize",
                    color: "yellow",
                    units: "M",
                  }),
                  Render.isWebGL
                    ? ((t._view[4] = {
                        title: "Shader",
                        value: "shaderCall",
                        color: "white",
                        units: "int",
                      }),
                      Render.is3DMode
                        ? ((t._view[0].title = "FPS(3D)"),
                          (t._view[5] = {
                            title: "TriFaces",
                            value: "trianglesFaces",
                            color: "white",
                            units: "int",
                          }),
                          (t._view[6] = {
                            title: "treeNodeColl",
                            value: "treeNodeCollision",
                            color: "white",
                            units: "int",
                          }),
                          (t._view[7] = {
                            title: "treeSpriteColl",
                            value: "treeSpriteCollision",
                            color: "white",
                            units: "int",
                          }))
                        : ((t._view[0].title = "FPS(WebGL)"),
                          (t._view[5] = {
                            title: "Canvas",
                            value: "_canvasStr",
                            color: "white",
                            units: "int",
                          })))
                    : (t._view[4] = {
                        title: "Canvas",
                        value: "_canvasStr",
                        color: "white",
                        units: "int",
                      }),
                  t._useCanvas ? t.createUIPre(e, i) : t.createUI(e, i),
                  t.enable());
          }),
          (t.createUIPre = function (e, i) {
            var n = Browser.pixelRatio;
            (t._width = 130 * n),
              (t._vx = 75 * n),
              (t._height = n * (12 * t._view.length + 3 * n) + 4),
              (t._fontSize = 12 * n);
            for (var s = 0; s < t._view.length; s++)
              (t._view[s].x = 4), (t._view[s].y = s * t._fontSize + 2 * n);
            t._canvas ||
              ((t._canvas = new HTMLCanvas("2D")).size(t._width, t._height),
              ((t._ctx = t._canvas.getContext("2d")).textBaseline = "top"),
              (t._ctx.font = t._fontSize + "px Sans-serif"),
              (t._canvas.source.style.cssText =
                "pointer-events:none;background:rgba(150,150,150,0.8);z-index:100000;position: absolute;direction:ltr;left:" +
                e +
                "px;top:" +
                i +
                "px;width:" +
                t._width / n +
                "px;height:" +
                t._height / n +
                "px;")),
              (t._first = !0),
              t.loop(),
              (t._first = !1),
              Browser.container.appendChild(t._canvas.source);
          }),
          (t.createUI = function (e, i) {
            var n = t._sp,
              s = Browser.pixelRatio;
            n ||
              ((n = new Sprite()),
              (t._leftText = new Text()).pos(5, 5),
              (t._leftText.color = "#ffffff"),
              n.addChild(t._leftText),
              (t._txt = new Text()).pos(80 * s, 5),
              (t._txt.color = "#ffffff"),
              n.addChild(t._txt),
              (t._sp = n)),
              n.pos(e, i);
            for (var r = "", a = 0; a < t._view.length; a++) {
              r += t._view[a].title + "\n";
            }
            t._leftText.text = r;
            var o = 138 * s,
              h = s * (12 * t._view.length + 3 * s) + 4;
            (t._txt.fontSize = t._fontSize * s),
              (t._leftText.fontSize = t._fontSize * s),
              n.size(o, h),
              n.graphics.clear(),
              n.graphics.setAlpha(0.5),
              n.graphics.drawRect(0, 0, o, h, "#999999"),
              n.graphics.setAlpha(1),
              t.loop();
          }),
          (t.enable = function () {
            Laya.timer.frameLoop(1, t, t.loop);
          }),
          (t.hide = function () {
            (t._show = !1),
              Laya.timer.clear(t, t.loop),
              t._canvas && Browser.removeElement(t._canvas.source);
          }),
          (t.clear = function () {
            t.trianglesFaces =
              t.drawCall =
              t.shaderCall =
              t.spriteCount =
              t.spriteRenderUseCacheCount =
              t.treeNodeCollision =
              t.treeSpriteCollision =
              t.canvasNormal =
              t.canvasBitmap =
              t.canvasReCache =
                0;
          }),
          (t.loop = function () {
            t._count++;
            var e = Browser.now();
            if (!(e - t._timer < 1e3)) {
              var i = t._count;
              if (((t.FPS = Math.round((1e3 * i) / (e - t._timer))), t._show)) {
                (t.trianglesFaces = Math.round(t.trianglesFaces / i)),
                  t._useCanvas
                    ? ((t.drawCall = Math.round(t.drawCall / i) - 2),
                      (t.shaderCall = Math.round(t.shaderCall / i)),
                      (t.spriteCount = Math.round(t.spriteCount / i) - 1))
                    : ((t.drawCall = Math.round(t.drawCall / i) - 2),
                      (t.shaderCall = Math.round(t.shaderCall / i) - 4),
                      (t.spriteCount = Math.round(t.spriteCount / i) - 4)),
                  (t.spriteRenderUseCacheCount = Math.round(
                    t.spriteRenderUseCacheCount / i
                  )),
                  (t.canvasNormal = Math.round(t.canvasNormal / i)),
                  (t.canvasBitmap = Math.round(t.canvasBitmap / i)),
                  (t.canvasReCache = Math.ceil(t.canvasReCache / i)),
                  (t.treeNodeCollision = Math.round(t.treeNodeCollision / i)),
                  (t.treeSpriteCollision = Math.round(
                    t.treeSpriteCollision / i
                  ));
                var n = t.FPS > 0 ? Math.floor(1e3 / t.FPS).toString() : " ";
                (t._fpsStr = t.FPS + (t.renderSlow ? " slow" : "") + " " + n),
                  (t._spriteStr =
                    t.spriteCount +
                    (t.spriteRenderUseCacheCount
                      ? "/" + t.spriteRenderUseCacheCount
                      : "")),
                  (t._canvasStr =
                    t.canvasReCache +
                    "/" +
                    t.canvasNormal +
                    "/" +
                    t.canvasBitmap),
                  (t.currentMemorySize =
                    ResourceManager.systemResourceManager.memorySize),
                  t._useCanvas ? t.renderInfoPre() : t.renderInfo(),
                  t.clear();
              }
              (t._count = 0), (t._timer = e);
            }
          }),
          (t.renderInfoPre = function () {
            if (t._canvas) {
              var e = t._ctx;
              e.clearRect(t._first ? 0 : t._vx, 0, t._width, t._height);
              for (var i = 0; i < t._view.length; i++) {
                var n = t._view[i];
                t._first &&
                  ((e.fillStyle = "white"),
                  e.fillText(n.title, n.x, n.y, null, null, null)),
                  (e.fillStyle = n.color);
                var s = t[n.value];
                "M" == n.units &&
                  (s = Math.floor((s / 1048576) * 100) / 100 + " M"),
                  e.fillText(s + "", n.x + t._vx, n.y, null, null, null);
              }
            }
          }),
          (t.renderInfo = function () {
            for (var e = "", i = 0; i < t._view.length; i++) {
              var n = t._view[i],
                s = t[n.value];
              "M" == n.units &&
                (s = Math.floor((s / 1048576) * 100) / 100 + " M"),
                "K" == n.units &&
                  (s = Math.floor((s / 1024) * 100) / 100 + " K"),
                (e += s + "\n");
            }
            t._txt.text = e;
          }),
          (t.FPS = 0),
          (t.loopCount = 0),
          (t.shaderCall = 0),
          (t.drawCall = 0),
          (t.trianglesFaces = 0),
          (t.spriteCount = 0),
          (t.spriteRenderUseCacheCount = 0),
          (t.treeNodeCollision = 0),
          (t.treeSpriteCollision = 0),
          (t.canvasNormal = 0),
          (t.canvasBitmap = 0),
          (t.canvasReCache = 0),
          (t.renderSlow = !1),
          (t.currentMemorySize = 0),
          (t._fpsStr = null),
          (t._canvasStr = null),
          (t._spriteStr = null),
          (t._fpsData = []),
          (t._timer = 0),
          (t._count = 0),
          (t._view = []),
          (t._fontSize = 12),
          (t._txt = null),
          (t._leftText = null),
          (t._sp = null),
          (t._show = !1),
          (t._useCanvas = !1),
          (t._canvas = null),
          (t._ctx = null),
          (t._first = !1),
          (t._vx = NaN),
          (t._width = 0),
          (t._height = 100),
          t
        );
      })(),
      StringKey = (function () {
        function t() {
          (this._strsToID = {}), (this._idToStrs = []), (this._length = 0);
        }
        __class(t, "laya.utils.StringKey");
        var e = t.prototype;
        return (
          (e.add = function (t) {
            var e = this._strsToID[t];
            return null != e
              ? e
              : ((this._idToStrs[this._length] = t),
                (this._strsToID[t] = this._length++));
          }),
          (e.getID = function (t) {
            var e = this._strsToID[t];
            return null == e ? -1 : e;
          }),
          (e.getName = function (t) {
            var e = this._idToStrs[t];
            return null == e ? void 0 : e;
          }),
          t
        );
      })(),
      Timer = (function () {
        function t() {
          (this._delta = 0),
            (this.scale = 1),
            (this.currFrame = 0),
            (this._mid = 1),
            (this._map = []),
            (this._laters = []),
            (this._handlers = []),
            (this._temp = []),
            (this._count = 0),
            (this.currTimer = this._now()),
            (this._lastTimer = this._now()),
            this._init();
        }
        var e;
        __class(t, "laya.utils.Timer");
        var i = t.prototype;
        return (
          (i._init = function () {
            Laya.timer && Laya.timer.frameLoop(1, this, this._update);
          }),
          (i._now = function () {
            return Date.now();
          }),
          (i._update = function () {
            if (this.scale <= 0) this._lastTimer = this._now();
            else {
              var t = (this.currFrame = this.currFrame + this.scale),
                e = this._now();
              this._delta = (e - this._lastTimer) * this.scale;
              var i = (this.currTimer = this.currTimer + this._delta);
              this._lastTimer = e;
              var n = this._handlers;
              for (this._count = 0, a = 0, o = n.length; a < o; a++)
                if (null !== (h = n[a]).method) {
                  var s = h.userFrame ? t : i;
                  if (s >= h.exeTime)
                    if (h.repeat)
                      if (h.jumpFrame)
                        for (; s >= h.exeTime; )
                          (h.exeTime += h.delay), h.run(!1);
                      else
                        (h.exeTime += h.delay),
                          h.run(!1),
                          s > h.exeTime &&
                            (h.exeTime +=
                              Math.ceil((s - h.exeTime) / h.delay) * h.delay);
                    else h.run(!0);
                } else this._count++;
              (this._count > 30 || t % 200 == 0) && this._clearHandlers();
              for (var r = this._laters, a = 0, o = r.length - 1; a <= o; a++) {
                var h = r[a];
                null !== h.method && ((this._map[h.key] = null), h.run(!1)),
                  this._recoverHandler(h),
                  a === o && (o = r.length - 1);
              }
              r.length = 0;
            }
          }),
          (i._clearHandlers = function () {
            for (var t = this._handlers, e = 0, i = t.length; e < i; e++) {
              var n = t[e];
              null !== n.method ? this._temp.push(n) : this._recoverHandler(n);
            }
            (this._handlers = this._temp),
              (this._temp = t),
              (this._temp.length = 0);
          }),
          (i._recoverHandler = function (e) {
            this._map[e.key] == e && (this._map[e.key] = null),
              e.clear(),
              t._pool.push(e);
          }),
          (i._create = function (i, n, s, r, a, o, h) {
            if (!s) return a.apply(r, o), null;
            if (h) {
              var l = this._getHandler(r, a);
              if (l)
                return (
                  (l.repeat = n),
                  (l.userFrame = i),
                  (l.delay = s),
                  (l.caller = r),
                  (l.method = a),
                  (l.args = o),
                  (l.exeTime =
                    s +
                    (i
                      ? this.currFrame
                      : this.currTimer + this._now() - this._lastTimer)),
                  l
                );
            }
            return (
              (l = t._pool.length > 0 ? t._pool.pop() : new e()),
              (l.repeat = n),
              (l.userFrame = i),
              (l.delay = s),
              (l.caller = r),
              (l.method = a),
              (l.args = o),
              (l.exeTime =
                s +
                (i
                  ? this.currFrame
                  : this.currTimer + this._now() - this._lastTimer) +
                1),
              this._indexHandler(l),
              this._handlers.push(l),
              l
            );
          }),
          (i._indexHandler = function (t) {
            var e = t.caller,
              i = t.method,
              n = e ? e.$_GID || (e.$_GID = Utils.getGID()) : 0,
              s = i.$_TID || (i.$_TID = 1e5 * this._mid++);
            (t.key = n + s), (this._map[t.key] = t);
          }),
          (i.once = function (t, e, i, n, s) {
            void 0 === s && (s = !0), this._create(!1, !1, t, e, i, n, s);
          }),
          (i.loop = function (t, e, i, n, s, r) {
            void 0 === s && (s = !0), void 0 === r && (r = !1);
            var a = this._create(!1, !0, t, e, i, n, s);
            a && (a.jumpFrame = r);
          }),
          (i.frameOnce = function (t, e, i, n, s) {
            void 0 === s && (s = !0), this._create(!0, !1, t, e, i, n, s);
          }),
          (i.frameLoop = function (t, e, i, n, s) {
            void 0 === s && (s = !0), this._create(!0, !0, t, e, i, n, s);
          }),
          (i.toString = function () {
            return (
              "callLater:" +
              this._laters.length +
              " handlers:" +
              this._handlers.length +
              " pool:" +
              t._pool.length
            );
          }),
          (i.clear = function (t, e) {
            var i = this._getHandler(t, e);
            i && ((this._map[i.key] = null), (i.key = 0), i.clear());
          }),
          (i.clearAll = function (t) {
            if (t)
              for (var e = 0, i = this._handlers.length; e < i; e++) {
                var n = this._handlers[e];
                n.caller === t &&
                  ((this._map[n.key] = null), (n.key = 0), n.clear());
              }
          }),
          (i._getHandler = function (t, e) {
            var i = t ? t.$_GID || (t.$_GID = Utils.getGID()) : 0,
              n = e.$_TID || (e.$_TID = 1e5 * this._mid++);
            return this._map[i + n];
          }),
          (i.callLater = function (i, n, s) {
            if (null == this._getHandler(i, n)) {
              if (t._pool.length) var r = t._pool.pop();
              else r = new e();
              (r.caller = i),
                (r.method = n),
                (r.args = s),
                this._indexHandler(r),
                this._laters.push(r);
            }
          }),
          (i.runCallLater = function (t, e) {
            var i = this._getHandler(t, e);
            i && null != i.method && ((this._map[i.key] = null), i.run(!0));
          }),
          (i.runTimer = function (t, e) {
            this.runCallLater(t, e);
          }),
          __getset(0, i, "delta", function () {
            return this._delta;
          }),
          (t._pool = []),
          (t.__init$ = function () {
            e = (function () {
              function t() {
                (this.key = 0),
                  (this.repeat = !1),
                  (this.delay = 0),
                  (this.userFrame = !1),
                  (this.exeTime = 0),
                  (this.caller = null),
                  (this.method = null),
                  (this.args = null),
                  (this.jumpFrame = !1);
              }
              __class(t, "");
              var e = t.prototype;
              return (
                (e.clear = function () {
                  (this.caller = null),
                    (this.method = null),
                    (this.args = null);
                }),
                (e.run = function (t) {
                  var e = this.caller;
                  if (e && e.destroyed) return this.clear();
                  var i = this.method,
                    n = this.args;
                  t && this.clear(),
                    null != i && (n ? i.apply(e, n) : i.call(e));
                }),
                t
              );
            })();
          }),
          t
        );
      })(),
      Tween = (function () {
        function t() {
          this.gid = 0;
        }
        __class(t, "laya.utils.Tween");
        var e = t.prototype;
        return (
          (e.to = function (t, e, i, n, s, r, a) {
            return (
              void 0 === r && (r = 0),
              void 0 === a && (a = !1),
              this._create(t, e, i, n, s, r, a, !0, !1, !0)
            );
          }),
          (e.from = function (t, e, i, n, s, r, a) {
            return (
              void 0 === r && (r = 0),
              void 0 === a && (a = !1),
              this._create(t, e, i, n, s, r, a, !1, !1, !0)
            );
          }),
          (e._create = function (e, i, n, s, r, a, o, h, l, c) {
            if (!e) throw new Error("Tween:target is null");
            (this._target = e),
              (this._duration = n),
              (this._ease = s || i.ease || t.easeNone),
              (this._complete = r || i.complete),
              (this._delay = a),
              (this._props = []),
              (this._usedTimer = 0),
              (this._startTimer = Browser.now()),
              (this._usedPool = l),
              (this._delayParam = null),
              (this.update = i.update);
            var u = e.$_GID || (e.$_GID = Utils.getGID());
            return (
              t.tweenMap[u]
                ? (o && t.clearTween(e), t.tweenMap[u].push(this))
                : (t.tweenMap[u] = [this]),
              c
                ? a <= 0
                  ? this.firstStart(e, i, h)
                  : ((this._delayParam = [e, i, h]),
                    Laya.scaleTimer.once(
                      a,
                      this,
                      this.firstStart,
                      this._delayParam
                    ))
                : this._initProps(e, i, h),
              this
            );
          }),
          (e.firstStart = function (t, e, i) {
            (this._delayParam = null),
              t.destroyed
                ? this.clear()
                : (this._initProps(t, e, i), this._beginLoop());
          }),
          (e._initProps = function (t, e, i) {
            for (var n in e)
              if ("number" == typeof t[n]) {
                var s = i ? t[n] : e[n],
                  r = i ? e[n] : t[n];
                this._props.push([n, s, r - s]), i || (t[n] = s);
              }
          }),
          (e._beginLoop = function () {
            Laya.scaleTimer.frameLoop(1, this, this._doEase);
          }),
          (e._doEase = function () {
            this._updateEase(Browser.now());
          }),
          (e._updateEase = function (e) {
            var i = this._target;
            if (i) {
              if (i.destroyed) return t.clearTween(i);
              var n = (this._usedTimer = e - this._startTimer - this._delay);
              if (!(n < 0)) {
                if (n >= this._duration) return this.complete();
                for (
                  var s = n > 0 ? this._ease(n, 0, 1, this._duration) : 0,
                    r = this._props,
                    a = 0,
                    o = r.length;
                  a < o;
                  a++
                ) {
                  var h = r[a];
                  i[h[0]] = h[1] + s * h[2];
                }
                this.update && this.update.run();
              }
            }
          }),
          (e.complete = function () {
            if (this._target) {
              Laya.scaleTimer.runTimer(this, this.firstStart);
              for (
                var t = this._target,
                  e = this._props,
                  i = this._complete,
                  n = 0,
                  s = e.length;
                n < s;
                n++
              ) {
                var r = e[n];
                t[r[0]] = r[1] + r[2];
              }
              this.update && this.update.run(), this.clear(), i && i.run();
            }
          }),
          (e.pause = function () {
            Laya.scaleTimer.clear(this, this._beginLoop),
              Laya.scaleTimer.clear(this, this._doEase),
              Laya.scaleTimer.clear(this, this.firstStart);
            var t = NaN;
            (t = Browser.now() - this._startTimer - this._delay) < 0 &&
              (this._usedTimer = t);
          }),
          (e.setStartTime = function (t) {
            this._startTimer = t;
          }),
          (e.clear = function () {
            this._target && (this._remove(), this._clear());
          }),
          (e._clear = function () {
            this.pause(),
              Laya.scaleTimer.clear(this, this.firstStart),
              (this._complete = null),
              (this._target = null),
              (this._ease = null),
              (this._props = null),
              (this._delayParam = null),
              this._usedPool &&
                ((this.update = null), Pool.recover("tween", this));
          }),
          (e.recover = function () {
            (this._usedPool = !0), this._clear();
          }),
          (e._remove = function () {
            var e = t.tweenMap[this._target.$_GID];
            if (e)
              for (var i = 0, n = e.length; i < n; i++)
                if (e[i] === this) {
                  e.splice(i, 1);
                  break;
                }
          }),
          (e.restart = function () {
            if (
              (this.pause(),
              (this._usedTimer = 0),
              (this._startTimer = Browser.now()),
              this._delayParam)
            )
              Laya.scaleTimer.once(
                this._delay,
                this,
                this.firstStart,
                this._delayParam
              );
            else {
              for (var t = this._props, e = 0, i = t.length; e < i; e++) {
                var n = t[e];
                this._target[n[0]] = n[1];
              }
              Laya.scaleTimer.once(this._delay, this, this._beginLoop);
            }
          }),
          (e.resume = function () {
            this._usedTimer >= this._duration ||
              ((this._startTimer =
                Browser.now() - this._usedTimer - this._delay),
              this._delayParam
                ? this._usedTimer < 0
                  ? Laya.scaleTimer.once(
                      -this._usedTimer,
                      this,
                      this.firstStart,
                      this._delayParam
                    )
                  : this.firstStart.apply(this, this._delayParam)
                : this._beginLoop());
          }),
          __getset(0, e, "progress", null, function (t) {
            var e = t * this._duration;
            this._startTimer = Browser.now() - this._delay - e;
          }),
          (t.to = function (e, i, n, s, r, a, o, h) {
            return (
              void 0 === a && (a = 0),
              void 0 === o && (o = !1),
              void 0 === h && (h = !0),
              Pool.getItemByClass("tween", t)._create(
                e,
                i,
                n,
                s,
                r,
                a,
                o,
                !0,
                h,
                !0
              )
            );
          }),
          (t.from = function (e, i, n, s, r, a, o, h) {
            return (
              void 0 === a && (a = 0),
              void 0 === o && (o = !1),
              void 0 === h && (h = !0),
              Pool.getItemByClass("tween", t)._create(
                e,
                i,
                n,
                s,
                r,
                a,
                o,
                !1,
                h,
                !0
              )
            );
          }),
          (t.clearAll = function (e) {
            if (e && e.$_GID) {
              var i = t.tweenMap[e.$_GID];
              if (i) {
                for (var n = 0, s = i.length; n < s; n++) i[n]._clear();
                i.length = 0;
              }
            }
          }),
          (t.clear = function (t) {
            t.clear();
          }),
          (t.clearTween = function (e) {
            t.clearAll(e);
          }),
          (t.easeNone = function (t, e, i, n) {
            return (i * t) / n + e;
          }),
          (t.tweenMap = {}),
          t
        );
      })(),
      Utils = (function () {
        function t() {}
        return (
          __class(t, "laya.utils.Utils"),
          (t.toRadian = function (e) {
            return e * t._pi2;
          }),
          (t.toAngle = function (e) {
            return e * t._pi;
          }),
          (t.toHexColor = function (t) {
            if (t < 0 || isNaN(t)) return null;
            for (var e = t.toString(16); e.length < 6; ) e = "0" + e;
            return "#" + e;
          }),
          (t.getGID = function () {
            return t._gid++;
          }),
          (t.concatArray = function (t, e) {
            if (!e) return t;
            if (!t) return e;
            var i = 0,
              n = e.length;
            for (i = 0; i < n; i++) t.push(e[i]);
            return t;
          }),
          (t.clearArray = function (t) {
            return t ? ((t.length = 0), t) : t;
          }),
          (t.copyArray = function (t, e) {
            if ((t || (t = []), !e)) return t;
            t.length = e.length;
            var i = 0,
              n = e.length;
            for (i = 0; i < n; i++) t[i] = e[i];
            return t;
          }),
          (t.getGlobalRecByPoints = function (t, e, i, n, s) {
            var r;
            (r = new Point(e, i)), (r = t.localToGlobal(r));
            var a;
            return (
              (a = new Point(n, s)),
              (a = t.localToGlobal(a)),
              Rectangle._getWrapRec([r.x, r.y, a.x, a.y])
            );
          }),
          (t.getGlobalPosAndScale = function (e) {
            return t.getGlobalRecByPoints(e, 0, 0, 1, 1);
          }),
          (t.bind = function (t, e) {
            return t.bind(e);
          }),
          (t.measureText = function (t, e) {
            return RunDriver.measureText(t, e);
          }),
          (t.updateOrder = function (t) {
            if (!t || t.length < 2) return !1;
            for (var e, i = 1, n = 0, s = t.length, r = NaN; i < s; ) {
              for (
                e = t[(n = i)], r = t[n]._zOrder;
                --n > -1 && t[n]._zOrder > r;

              )
                t[n + 1] = t[n];
              (t[n + 1] = e), i++;
            }
            var a = e.parent.conchModel;
            if (a)
              if (null != a.updateZOrder) a.updateZOrder();
              else {
                for (i = 0; i < s; i++) a.removeChild(t[i].conchModel);
                for (i = 0; i < s; i++) a.addChildAt(t[i].conchModel, i);
              }
            return !0;
          }),
          (t.transPointList = function (t, e, i) {
            var n = 0,
              s = t.length;
            for (n = 0; n < s; n += 2) (t[n] += e), (t[n + 1] += i);
          }),
          (t.parseInt = function (t, e) {
            void 0 === e && (e = 0);
            var i = Browser.window.parseInt(t, e);
            return isNaN(i) ? 0 : i;
          }),
          (t.getFileExtension = function (e) {
            t._extReg.lastIndex = e.lastIndexOf(".");
            var i = t._extReg.exec(e);
            return i && i.length > 1 ? i[1].toLowerCase() : null;
          }),
          (t.getTransformRelativeToWindow = function (t, e, i) {
            var n = Laya.stage,
              s = laya.utils.Utils.getGlobalPosAndScale(t),
              r = n._canvasTransform.clone(),
              a = r.tx,
              o = r.ty;
            r.rotate((-Math.PI / 180) * Laya.stage.canvasDegree),
              r.scale(Laya.stage.clientScaleX, Laya.stage.clientScaleY);
            var h = Laya.stage.canvasDegree % 180 != 0,
              l = NaN,
              c = NaN;
            h
              ? ((l = i + s.y),
                (c = e + s.x),
                (l *= r.d),
                (c *= r.a),
                90 == Laya.stage.canvasDegree
                  ? ((l = a - l), (c += o))
                  : ((l += a), (c = o - c)))
              : ((l = e + s.x),
                (c = i + s.y),
                (l *= r.a),
                (c *= r.d),
                (l += a),
                (c += o));
            var u = NaN,
              _ = NaN;
            return (
              h
                ? ((u = r.d * s.height), (_ = r.a * s.width))
                : ((u = r.a * s.width), (_ = r.d * s.height)),
              { x: l, y: c, scaleX: u, scaleY: _ }
            );
          }),
          (t.fitDOMElementInArea = function (e, i, n, s, r, a) {
            e._fitLayaAirInitialized ||
              ((e._fitLayaAirInitialized = !0),
              (e.style.transformOrigin = e.style.webKittransformOrigin =
                "left top"),
              (e.style.position = "absolute"));
            var o = t.getTransformRelativeToWindow(i, n, s);
            (e.style.transform = e.style.webkitTransform =
              "scale(" +
              o.scaleX +
              "," +
              o.scaleY +
              ") rotate(" +
              Laya.stage.canvasDegree +
              "deg)"),
              (e.style.width = r + "px"),
              (e.style.height = a + "px"),
              (e.style.left = o.x + "px"),
              (e.style.top = o.y + "px");
          }),
          (t.isOkTextureList = function (t) {
            if (!t) return !1;
            var e,
              i = 0,
              n = t.length;
            for (i = 0; i < n; i++) if (!(e = t[i]) || !e.source) return !1;
            return !0;
          }),
          (t.isOKCmdList = function (t) {
            if (!t) return !1;
            var e,
              i,
              n = 0,
              s = t.length,
              r = Render._context;
            for (n = 0; n < s; n++)
              switch ((e = t[n]).callee) {
                case r._drawTexture:
                case r._fillTexture:
                case r._drawTextureWithTransform:
                  if (!(i = e[0]) || !i.source) return !1;
              }
            return !0;
          }),
          (t._gid = 1),
          (t._pi = 180 / Math.PI),
          (t._pi2 = Math.PI / 180),
          (t._extReg = /\.(\w+)\??/g),
          (t.parseXMLFromString = function (t) {
            var e;
            if (
              ((t = t.replace(/>\s+</g, "><")),
              (e = new DOMParser().parseFromString(
                t,
                "text/xml"
              )).firstChild.textContent.indexOf(
                "This page contains the following errors"
              ) > -1)
            )
              throw new Error(e.firstChild.firstChild.textContent);
            return e;
          }),
          t
        );
      })(),
      VectorGraphManager = (function () {
        function t() {
          (this.useDic = {}),
            (this.shapeDic = {}),
            (this.shapeLineDic = {}),
            (this._id = 0),
            (this._checkKey = !1),
            (this._freeIdArray = []),
            Render.isWebGL &&
              CacheManager.regCacheByFunction(
                Utils.bind(this.startDispose, this),
                Utils.bind(this.getCacheList, this)
              );
        }
        __class(t, "laya.utils.VectorGraphManager");
        var e = t.prototype;
        return (
          (e.getId = function () {
            return this._id++;
          }),
          (e.addShape = function (t, e) {
            (this.shapeDic[t] = e), this.useDic[t] || (this.useDic[t] = !0);
          }),
          (e.addLine = function (t, e) {
            (this.shapeLineDic[t] = e),
              this.shapeLineDic[t] || (this.shapeLineDic[t] = !0);
          }),
          (e.getShape = function (t) {
            this._checkKey && null != this.useDic[t] && (this.useDic[t] = !0);
          }),
          (e.deleteShape = function (t) {
            this.shapeDic[t] &&
              ((this.shapeDic[t] = null), delete this.shapeDic[t]),
              this.shapeLineDic[t] &&
                ((this.shapeLineDic[t] = null), delete this.shapeLineDic[t]),
              null != this.useDic[t] && delete this.useDic[t];
          }),
          (e.getCacheList = function () {
            var t,
              e = [];
            for (t in this.shapeDic) e.push(this.shapeDic[t]);
            for (t in this.shapeLineDic) e.push(this.shapeLineDic[t]);
            return e;
          }),
          (e.startDispose = function (t) {
            var e;
            for (e in this.useDic) this.useDic[e] = !1;
            this._checkKey = !0;
          }),
          (e.endDispose = function () {
            if (this._checkKey) {
              var t;
              for (t in this.useDic) this.useDic[t] || this.deleteShape(t);
              this._checkKey = !1;
            }
          }),
          (t.getInstance = function () {
            return (t.instance = t.instance || new t());
          }),
          (t.instance = null),
          t
        );
      })(),
      WeakObject = (function () {
        function t() {
          (this._obj = null),
            (this._obj = t.supportWeakMap ? new Browser.window.WeakMap() : {}),
            t.supportWeakMap || t._maps.push(this);
        }
        __class(t, "laya.utils.WeakObject");
        var e = t.prototype;
        return (
          (e.set = function (e, i) {
            if (null != e)
              if (t.supportWeakMap) {
                var n = e;
                ("string" != typeof e && "number" != typeof e) ||
                  (n = t._keys[e]) ||
                  (n = t._keys[e] = { k: e }),
                  this._obj.set(n, i);
              } else
                "string" == typeof e || "number" == typeof e
                  ? (this._obj[e] = i)
                  : (e.$_GID || (e.$_GID = Utils.getGID()),
                    (this._obj[e.$_GID] = i));
          }),
          (e.get = function (e) {
            if (null == e) return null;
            if (t.supportWeakMap) {
              var i =
                "string" == typeof e || "number" == typeof e ? t._keys[e] : e;
              return i ? this._obj.get(i) : null;
            }
            return "string" == typeof e || "number" == typeof e
              ? this._obj[e]
              : this._obj[e.$_GID];
          }),
          (e.del = function (e) {
            if (null != e)
              if (t.supportWeakMap) {
                var i =
                  "string" == typeof e || "number" == typeof e ? t._keys[e] : e;
                if (!i) return;
                this._obj.delete(i);
              } else
                "string" == typeof e || "number" == typeof e
                  ? delete this._obj[e]
                  : delete this._obj[this._obj.$_GID];
          }),
          (e.has = function (e) {
            if (null == e) return !1;
            if (t.supportWeakMap) {
              var i =
                "string" == typeof e || "number" == typeof e ? t._keys[e] : e;
              return this._obj.has(i);
            }
            return "string" == typeof e || "number" == typeof e
              ? null != this._obj[e]
              : null != this._obj[this._obj.$_GID];
          }),
          (t.__init__ = function () {
            (t.supportWeakMap = null != Browser.window.WeakMap) ||
              Laya.timer.loop(t.delInterval, null, t.clearCache);
          }),
          (t.clearCache = function () {
            for (var e = 0, i = t._maps.length; e < i; e++) {
              t._maps[e]._obj = {};
            }
          }),
          (t.supportWeakMap = !1),
          (t.delInterval = 3e5),
          (t._keys = {}),
          (t._maps = []),
          __static(t, [
            "I",
            function () {
              return (this.I = new t());
            },
          ]),
          t
        );
      })(),
      WordText = (function () {
        function t() {
          (this.id = NaN),
            (this.save = []),
            (this.toUpperCase = null),
            (this.changed = !1),
            (this._text = null);
        }
        __class(t, "laya.utils.WordText");
        var e = t.prototype;
        return (
          (e.setText = function (t) {
            (this.changed = !0), (this._text = t);
          }),
          (e.toString = function () {
            return this._text;
          }),
          (e.charCodeAt = function (t) {
            return this._text ? this._text.charCodeAt(t) : NaN;
          }),
          (e.charAt = function (t) {
            return this._text ? this._text.charAt(t) : null;
          }),
          __getset(0, e, "length", function () {
            return this._text ? this._text.length : 0;
          }),
          t
        );
      })(),
      Node = (function (t) {
        function e() {
          (this._bits = 0),
            (this._displayedInStage = !1),
            (this._parent = null),
            (this.conchModel = null),
            (this.name = ""),
            (this._destroyed = !1),
            e.__super.call(this),
            (this._childs = e.ARRAY_EMPTY),
            (this._$P = e.PROP_EMPTY),
            (this.timer = Laya.scaleTimer),
            (this.conchModel = Render.isConchNode
              ? this.createConchModel()
              : null);
        }
        __class(e, "laya.display.Node", EventDispatcher);
        var i = e.prototype;
        return (
          (i._setBit = function (t, e) {
            if (1 == t) {
              this._getBit(t) != e && this._updateDisplayedInstage();
            }
            e ? (this._bits |= t) : (this._bits &= ~t);
          }),
          (i._getBit = function (t) {
            return 0 != (this._bits & t);
          }),
          (i._setUpNoticeChain = function () {
            this._getBit(1) && this._setUpNoticeType(1);
          }),
          (i._setUpNoticeType = function (t) {
            var e = this;
            for (e._setBit(t, !0), e = e.parent; e; ) {
              if (e._getBit(t)) return;
              e._setBit(t, !0), (e = e.parent);
            }
          }),
          (i.on = function (t, e, i, n) {
            return (
              ("display" !== t && "undisplay" !== t) ||
                this._getBit(1) ||
                this._setUpNoticeType(1),
              this._createListener(t, e, i, n, !1)
            );
          }),
          (i.once = function (t, e, i, n) {
            return (
              ("display" !== t && "undisplay" !== t) ||
                this._getBit(1) ||
                this._setUpNoticeType(1),
              this._createListener(t, e, i, n, !0)
            );
          }),
          (i.createConchModel = function () {
            return null;
          }),
          (i.destroy = function (t) {
            void 0 === t && (t = !0),
              (this._destroyed = !0),
              this._parent && this._parent.removeChild(this),
              this._childs &&
                (t ? this.destroyChildren() : this.removeChildren()),
              (this._childs = null),
              (this._$P = null),
              this.offAll(),
              this.timer.clearAll(this);
          }),
          (i.destroyChildren = function () {
            if (this._childs)
              for (var t = this._childs.length - 1; t > -1; t--)
                this._childs[t].destroy(!0);
          }),
          (i.addChild = function (t) {
            if (!t || this.destroyed || t === this) return t;
            if (
              (t.zOrder && this._set$P("hasZorder", !0), t._parent === this)
            ) {
              var i = this.getChildIndex(t);
              i !== this._childs.length - 1 &&
                (this._childs.splice(i, 1),
                this._childs.push(t),
                this.conchModel &&
                  (this.conchModel.removeChild(t.conchModel),
                  this.conchModel.addChildAt(
                    t.conchModel,
                    this._childs.length - 1
                  )),
                this._childChanged());
            } else
              t.parent && t.parent.removeChild(t),
                this._childs === e.ARRAY_EMPTY && (this._childs = []),
                this._childs.push(t),
                this.conchModel &&
                  this.conchModel.addChildAt(
                    t.conchModel,
                    this._childs.length - 1
                  ),
                (t.parent = this),
                this._childChanged();
            return t;
          }),
          (i.addChildren = function (t) {
            for (var e = arguments, i = 0, n = e.length; i < n; )
              this.addChild(e[i++]);
          }),
          (i.addChildAt = function (t, i) {
            if (!t || this.destroyed || t === this) return t;
            if (
              (t.zOrder && this._set$P("hasZorder", !0),
              i >= 0 && i <= this._childs.length)
            ) {
              if (t._parent === this) {
                var n = this.getChildIndex(t);
                this._childs.splice(n, 1),
                  this._childs.splice(i, 0, t),
                  this.conchModel &&
                    (this.conchModel.removeChild(t.conchModel),
                    this.conchModel.addChildAt(t.conchModel, i)),
                  this._childChanged();
              } else
                t.parent && t.parent.removeChild(t),
                  this._childs === e.ARRAY_EMPTY && (this._childs = []),
                  this._childs.splice(i, 0, t),
                  this.conchModel &&
                    this.conchModel.addChildAt(t.conchModel, i),
                  (t.parent = this);
              return t;
            }
            throw new Error("appendChildAt:The index is out of bounds");
          }),
          (i.getChildIndex = function (t) {
            return this._childs.indexOf(t);
          }),
          (i.getChildByName = function (t) {
            var e = this._childs;
            if (e)
              for (var i = 0, n = e.length; i < n; i++) {
                var s = e[i];
                if (s.name === t) return s;
              }
            return null;
          }),
          (i._get$P = function (t) {
            return this._$P[t];
          }),
          (i._set$P = function (t, i) {
            return (
              this.destroyed ||
                (this._$P === e.PROP_EMPTY && (this._$P = {}),
                (this._$P[t] = i)),
              i
            );
          }),
          (i.getChildAt = function (t) {
            return this._childs[t];
          }),
          (i.setChildIndex = function (t, e) {
            var i = this._childs;
            if (e < 0 || e >= i.length)
              throw new Error("setChildIndex:The index is out of bounds.");
            var n = this.getChildIndex(t);
            if (n < 0)
              throw new Error(
                "setChildIndex:node is must child of this object."
              );
            return (
              i.splice(n, 1),
              i.splice(e, 0, t),
              this.conchModel &&
                (this.conchModel.removeChild(t.conchModel),
                this.conchModel.addChildAt(t.conchModel, e)),
              this._childChanged(),
              t
            );
          }),
          (i._childChanged = function (t) {}),
          (i.removeChild = function (t) {
            if (!this._childs) return t;
            var e = this._childs.indexOf(t);
            return this.removeChildAt(e);
          }),
          (i.removeSelf = function () {
            return this._parent && this._parent.removeChild(this), this;
          }),
          (i.removeChildByName = function (t) {
            var e = this.getChildByName(t);
            return e && this.removeChild(e), e;
          }),
          (i.removeChildAt = function (t) {
            var e = this.getChildAt(t);
            return (
              e &&
                (this._childs.splice(t, 1),
                this.conchModel && this.conchModel.removeChild(e.conchModel),
                (e.parent = null)),
              e
            );
          }),
          (i.removeChildren = function (t, i) {
            if (
              (void 0 === t && (t = 0),
              void 0 === i && (i = 2147483647),
              this._childs && this._childs.length > 0)
            ) {
              var n = this._childs;
              if (0 === t && i >= a) {
                var s = n;
                this._childs = e.ARRAY_EMPTY;
              } else s = n.splice(t, i - t);
              for (var r = 0, a = s.length; r < a; r++)
                (s[r].parent = null),
                  this.conchModel &&
                    this.conchModel.removeChild(s[r].conchModel);
            }
            return this;
          }),
          (i.replaceChild = function (t, e) {
            var i = this._childs.indexOf(e);
            return i > -1
              ? (this._childs.splice(i, 1, t),
                this.conchModel &&
                  (this.conchModel.removeChild(e.conchModel),
                  this.conchModel.addChildAt(t.conchModel, i)),
                (e.parent = null),
                (t.parent = this),
                t)
              : null;
          }),
          (i._updateDisplayedInstage = function () {
            var t;
            t = this;
            var e = Laya.stage;
            for (this._displayedInStage = !1; t; ) {
              if (t._getBit(1)) {
                this._displayedInStage = t._displayedInStage;
                break;
              }
              if (t == e || t._displayedInStage) {
                this._displayedInStage = !0;
                break;
              }
              t = t.parent;
            }
          }),
          (i._setDisplay = function (t) {
            this._displayedInStage !== t &&
              ((this._displayedInStage = t),
              t ? this.event("display") : this.event("undisplay"));
          }),
          (i._displayChild = function (t, e) {
            var i = t._childs;
            if (i)
              for (var n = 0, s = i.length; n < s; n++) {
                var r = i[n];
                r._getBit(1) &&
                  (r._childs.length > 0
                    ? this._displayChild(r, e)
                    : r._setDisplay(e));
              }
            t._setDisplay(e);
          }),
          (i.contains = function (t) {
            if (t === this) return !0;
            for (; t; ) {
              if (t.parent === this) return !0;
              t = t.parent;
            }
            return !1;
          }),
          (i.timerLoop = function (t, e, i, n, s, r) {
            void 0 === s && (s = !0),
              void 0 === r && (r = !1),
              this.timer.loop(t, e, i, n, s, r);
          }),
          (i.timerOnce = function (t, e, i, n, s) {
            void 0 === s && (s = !0), this.timer._create(!1, !1, t, e, i, n, s);
          }),
          (i.frameLoop = function (t, e, i, n, s) {
            void 0 === s && (s = !0), this.timer._create(!0, !0, t, e, i, n, s);
          }),
          (i.frameOnce = function (t, e, i, n, s) {
            void 0 === s && (s = !0), this.timer._create(!0, !1, t, e, i, n, s);
          }),
          (i.clearTimer = function (t, e) {
            this.timer.clear(t, e);
          }),
          __getset(0, i, "numChildren", function () {
            return this._childs.length;
          }),
          __getset(0, i, "destroyed", function () {
            return this._destroyed;
          }),
          __getset(
            0,
            i,
            "parent",
            function () {
              return this._parent;
            },
            function (t) {
              this._parent !== t &&
                (t
                  ? ((this._parent = t),
                    this.event("added"),
                    this._getBit(1) &&
                      (this._setUpNoticeChain(),
                      t.displayedInStage && this._displayChild(this, !0)),
                    t._childChanged(this))
                  : (this.event("removed"),
                    this._parent._childChanged(),
                    this._getBit(1) && this._displayChild(this, !1),
                    (this._parent = t)));
            }
          ),
          __getset(0, i, "displayedInStage", function () {
            return this._getBit(1)
              ? this._displayedInStage
              : (this._setUpNoticeType(1), this._displayedInStage);
          }),
          (e.ARRAY_EMPTY = []),
          (e.PROP_EMPTY = {}),
          (e.NOTICE_DISPLAY = 1),
          (e.MOUSEENABLE = 2),
          e
        );
      })(),
      CSSStyle = (function (t) {
        function e(t) {
          (this._bgground = null),
            (this._border = null),
            (this._rect = null),
            (this.underLine = 0),
            (this.lineHeight = 0),
            e.__super.call(this),
            (this._padding = e._PADDING),
            (this._spacing = e._SPACING),
            (this._aligns = e._ALIGNS),
            (this._font = Font.EMPTY),
            (this._ower = t);
        }
        __class(e, "laya.display.css.CSSStyle", t);
        var i = e.prototype;
        return (
          (i.destroy = function () {
            (this._ower = null), (this._font = null), (this._rect = null);
          }),
          (i.inherit = function (t) {
            (this._font = t._font),
              (this._spacing =
                t._spacing === e._SPACING ? e._SPACING : t._spacing.slice()),
              (this.lineHeight = t.lineHeight);
          }),
          (i._widthAuto = function () {
            return 0 != (262144 & this._type);
          }),
          (i.widthed = function (t) {
            return 0 != (8 & this._type);
          }),
          (i._calculation = function (t, e) {
            function i(t, e, i) {
              return t * i[0] + e * i[1] + i[2];
            }
            function n(t) {
              var e = r.width,
                n = s.width;
              a.width && (s.width = i(e, n, a.width)),
                a.height && (s.height = i(e, n, a.height)),
                a.left && (s.x = i(e, n, a.left)),
                a.top && (s.y = i(e, n, a.top));
            }
            if (e.indexOf("%") < 0) return !1;
            var s = this._ower,
              r = s.parent,
              a = this._rect;
            null === a &&
              ((r._getCSSStyle()._type |= 524288),
              r.on("resize", this, n),
              (this._rect = a = { input: {} }));
            var o = e.split(" ");
            return (
              (o[0] = parseFloat(o[0]) / 100),
              1 == o.length
                ? (o[1] = o[2] = 0)
                : ((o[1] = parseFloat(o[1]) / 100), (o[2] = parseFloat(o[2]))),
              (a[t] = o),
              (a.input[t] = e),
              n(),
              !0
            );
          }),
          (i.heighted = function (t) {
            return 0 != (8192 & this._type);
          }),
          (i.size = function (t, e) {
            var i = this._ower,
              n = !1;
            -1 !== t &&
              t != this._ower.width &&
              ((this._type |= 8), (this._ower.width = t), (n = !0)),
              -1 !== e &&
                e != this._ower.height &&
                ((this._type |= 8192), (this._ower.height = e), (n = !0)),
              n &&
                (i._layoutLater(),
                524288 & this._type && i.event("resize", this));
          }),
          (i._getAlign = function () {
            return this._aligns[0];
          }),
          (i._getValign = function () {
            return this._aligns[1];
          }),
          (i._getCssFloat = function () {
            return 0 != (32768 & this._type) ? 32768 : 0;
          }),
          (i._createFont = function () {
            return 4096 & this._type
              ? this._font
              : ((this._type |= 4096), (this._font = new Font(this._font)));
          }),
          (i.render = function (t, e, i, n) {
            var s = t.width,
              r = t.height;
            (i -= t.pivotX),
              (n -= t.pivotY),
              this._bgground &&
                null != this._bgground.color &&
                e.ctx.fillRect(i, n, s, r, this._bgground.color),
              this._border &&
                this._border.color &&
                e.drawRect(
                  i,
                  n,
                  s,
                  r,
                  this._border.color.strColor,
                  this._border.size
                );
          }),
          (i.getCSSStyle = function () {
            return this;
          }),
          (i.cssText = function (t) {
            this.attrs(e.parseOneCSS(t, ";"));
          }),
          (i.attrs = function (t) {
            if (t)
              for (var e = 0, i = t.length; e < i; e++) {
                var n = t[e];
                this[n[0]] = n[1];
              }
          }),
          (i.setTransform = function (t) {
            "none" === t
              ? (this._tf = Style._TF_EMPTY)
              : this.attrs(e.parseOneCSS(t, ","));
          }),
          (i.translate = function (t, e) {
            this._tf === Style._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.translateX = t),
              (this._tf.translateY = e);
          }),
          (i.scale = function (t, e) {
            this._tf === Style._TF_EMPTY && (this._tf = new TransformInfo()),
              (this._tf.scaleX = t),
              (this._tf.scaleY = e);
          }),
          (i._enableLayout = function () {
            return 0 == (2 & this._type) && 0 == (4 & this._type);
          }),
          __getset(0, i, "block", t.prototype._$get_block, function (t) {
            t ? (this._type |= 1) : (this._type &= -2);
          }),
          __getset(
            0,
            i,
            "valign",
            function () {
              return e._valigndef[this._aligns[1]];
            },
            function (t) {
              this._aligns === e._ALIGNS && (this._aligns = [0, 0, 0]),
                (this._aligns[1] = e._valigndef[t]);
            }
          ),
          __getset(0, i, "height", null, function (t) {
            if (((this._type |= 8192), "string" == typeof t)) {
              if (this._calculation("height", t)) return;
              t = parseInt(t);
            }
            this.size(-1, t);
          }),
          __getset(0, i, "width", null, function (t) {
            if (((this._type |= 8), "string" == typeof t)) {
              var e = t.indexOf("auto");
              if (
                (e >= 0 && ((this._type |= 262144), (t = t.substr(0, e))),
                this._calculation("width", t))
              )
                return;
              t = parseInt(t);
            }
            this.size(t, -1);
          }),
          __getset(
            0,
            i,
            "fontWeight",
            function () {
              return this._font.weight;
            },
            function (t) {
              this._createFont().weight = t;
            }
          ),
          __getset(0, i, "left", null, function (t) {
            var e = this._ower;
            if ("string" == typeof t) {
              if (
                ("center" === t
                  ? (t = "50% -50% 0")
                  : "right" === t && (t = "100% -100% 0"),
                this._calculation("left", t))
              )
                return;
              t = parseInt(t);
            }
            e.x = t;
          }),
          __getset(0, i, "_translate", null, function (t) {
            this.translate(t[0], t[1]);
          }),
          __getset(0, i, "absolute", function () {
            return 0 != (4 & this._type);
          }),
          __getset(0, i, "top", null, function (t) {
            var e = this._ower;
            if ("string" == typeof t) {
              if (
                ("middle" === t
                  ? (t = "50% -50% 0")
                  : "bottom" === t && (t = "100% -100% 0"),
                this._calculation("top", t))
              )
                return;
              t = parseInt(t);
            }
            e.y = t;
          }),
          __getset(
            0,
            i,
            "align",
            function () {
              return e._aligndef[this._aligns[0]];
            },
            function (t) {
              this._aligns === e._ALIGNS && (this._aligns = [0, 0, 0]),
                (this._aligns[0] = e._aligndef[t]);
            }
          ),
          __getset(
            0,
            i,
            "bold",
            function () {
              return this._font.bold;
            },
            function (t) {
              this._createFont().bold = t;
            }
          ),
          __getset(
            0,
            i,
            "padding",
            function () {
              return this._padding;
            },
            function (t) {
              this._padding = t;
            }
          ),
          __getset(
            0,
            i,
            "leading",
            function () {
              return this._spacing[1];
            },
            function (t) {
              "string" == typeof t && (t = parseInt(t + "")),
                this._spacing === e._SPACING && (this._spacing = [0, 0]),
                (this._spacing[1] = t);
            }
          ),
          __getset(
            0,
            i,
            "lineElement",
            function () {
              return 0 != (65536 & this._type);
            },
            function (t) {
              t ? (this._type |= 65536) : (this._type &= -65537);
            }
          ),
          __getset(
            0,
            i,
            "cssFloat",
            function () {
              return 0 != (32768 & this._type) ? "right" : "left";
            },
            function (t) {
              (this.lineElement = !1),
                "right" === t ? (this._type |= 32768) : (this._type &= -32769);
            }
          ),
          __getset(
            0,
            i,
            "textDecoration",
            function () {
              return this._font.decoration;
            },
            function (t) {
              this._createFont().decoration = t;
            }
          ),
          __getset(
            0,
            i,
            "whiteSpace",
            function () {
              return 131072 & this._type ? "nowrap" : "";
            },
            function (t) {
              "nowrap" === t && (this._type |= 131072),
                "none" === t && (this._type &= -131073);
            }
          ),
          __getset(0, i, "background", null, function (t) {
            t
              ? (this._bgground || (this._bgground = {}),
                (this._bgground.color = t),
                this._ower.conchModel && this._ower.conchModel.bgColor(t),
                (this._type |= 16384),
                (this._ower._renderType |= 256))
              : (this._bgground = null);
          }),
          __getset(
            0,
            i,
            "wordWrap",
            function () {
              return 0 == (131072 & this._type);
            },
            function (t) {
              t ? (this._type &= -131073) : (this._type |= 131072);
            }
          ),
          __getset(
            0,
            i,
            "color",
            function () {
              return this._font.color;
            },
            function (t) {
              this._createFont().color = t;
            }
          ),
          __getset(
            0,
            i,
            "password",
            function () {
              return this._font.password;
            },
            function (t) {
              this._createFont().password = t;
            }
          ),
          __getset(
            0,
            i,
            "backgroundColor",
            function () {
              return this._bgground ? this._bgground.color : null;
            },
            function (t) {
              "none" === t
                ? (this._bgground = null)
                : (this._bgground || (this._bgground = {}),
                  (this._bgground.color = t)),
                this._ower.conchModel && this._ower.conchModel.bgColor(t),
                (this._ower._renderType |= 256);
            }
          ),
          __getset(
            0,
            i,
            "font",
            function () {
              return this._font.toString();
            },
            function (t) {
              this._createFont().set(t);
            }
          ),
          __getset(0, i, "weight", null, function (t) {
            this._createFont().weight = t;
          }),
          __getset(
            0,
            i,
            "letterSpacing",
            function () {
              return this._spacing[0];
            },
            function (t) {
              "string" == typeof t && (t = parseInt(t + "")),
                this._spacing === e._SPACING && (this._spacing = [0, 0]),
                (this._spacing[0] = t);
            }
          ),
          __getset(
            0,
            i,
            "fontSize",
            function () {
              return this._font.size;
            },
            function (t) {
              this._createFont().size = t;
            }
          ),
          __getset(
            0,
            i,
            "italic",
            function () {
              return this._font.italic;
            },
            function (t) {
              this._createFont().italic = t;
            }
          ),
          __getset(
            0,
            i,
            "fontFamily",
            function () {
              return this._font.family;
            },
            function (t) {
              this._createFont().family = t;
            }
          ),
          __getset(
            0,
            i,
            "stroke",
            function () {
              return this._font.stroke[0];
            },
            function (t) {
              this._createFont().stroke === Font._STROKE &&
                (this._font.stroke = [0, "#000000"]),
                (this._font.stroke[0] = t);
            }
          ),
          __getset(
            0,
            i,
            "strokeColor",
            function () {
              return this._font.stroke[1];
            },
            function (t) {
              this._createFont().stroke === Font._STROKE &&
                (this._font.stroke = [0, "#000000"]),
                (this._font.stroke[1] = t);
            }
          ),
          __getset(
            0,
            i,
            "border",
            function () {
              return this._border ? this._border.value : "";
            },
            function (t) {
              if ("none" != t) {
                this._border || (this._border = {}), (this._border.value = t);
                var e = t.split(" ");
                if (
                  ((this._border.color = Color.create(e[e.length - 1])),
                  1 == e.length)
                )
                  return (
                    (this._border.size = 1), void (this._border.type = "solid")
                  );
                var i = 0;
                e[0].indexOf("px") > 0
                  ? ((this._border.size = parseInt(e[0])), i++)
                  : (this._border.size = 1),
                  (this._border.type = e[i]),
                  (this._ower._renderType |= 256);
              } else this._border = null;
            }
          ),
          __getset(
            0,
            i,
            "borderColor",
            function () {
              return this._border && this._border.color
                ? this._border.color.strColor
                : null;
            },
            function (t) {
              t
                ? (this._border || (this._border = { size: 1, type: "solid" }),
                  (this._border.color = null == t ? null : Color.create(t)),
                  this._ower.conchModel &&
                    this._ower.conchModel.border(this._border.color.strColor),
                  (this._ower._renderType |= 256))
                : (this._border = null);
            }
          ),
          __getset(
            0,
            i,
            "position",
            function () {
              return 4 & this._type ? "absolute" : "";
            },
            function (t) {
              "absolute" == t ? (this._type |= 4) : (this._type &= -5);
            }
          ),
          __getset(0, i, "display", null, function (t) {
            switch (t) {
              case "":
                (this._type &= -3), (this.visible = !0);
                break;
              case "none":
                (this._type |= 2),
                  (this.visible = !1),
                  this._ower._layoutLater();
            }
          }),
          __getset(0, i, "paddingLeft", function () {
            return this.padding[3];
          }),
          __getset(0, i, "paddingTop", function () {
            return this.padding[0];
          }),
          __getset(0, i, "_scale", null, function (t) {
            this._ower.scale(t[0], t[1]);
          }),
          __getset(0, i, "_rotate", null, function (t) {
            this._ower.rotation = t;
          }),
          (e.parseOneCSS = function (t, i) {
            for (
              var n, s = [], r = t.split(i), a = 0, o = r.length;
              a < o;
              a++
            ) {
              var h = r[a],
                l = h.indexOf(":"),
                c = h.substr(0, l).replace(/^\s+|\s+$/g, "");
              if (0 != c.length) {
                var u = h.substr(l + 1).replace(/^\s+|\s+$/g, ""),
                  _ = [c, u];
                switch (c) {
                  case "italic":
                  case "bold":
                    _[1] = "true" == u;
                    break;
                  case "line-height":
                    (_[0] = "lineHeight"), (_[1] = parseInt(u));
                    break;
                  case "font-size":
                    (_[0] = "fontSize"), (_[1] = parseInt(u));
                    break;
                  case "padding":
                    (n = u.split(" ")).length > 1 ||
                      (n[1] = n[2] = n[3] = n[0]),
                      (_[1] = [
                        parseInt(n[0]),
                        parseInt(n[1]),
                        parseInt(n[2]),
                        parseInt(n[3]),
                      ]);
                    break;
                  case "rotate":
                    (_[0] = "_rotate"), (_[1] = parseFloat(u));
                    break;
                  case "scale":
                    (n = u.split(" ")),
                      (_[0] = "_scale"),
                      (_[1] = [parseFloat(n[0]), parseFloat(n[1])]);
                    break;
                  case "translate":
                    (n = u.split(" ")),
                      (_[0] = "_translate"),
                      (_[1] = [parseInt(n[0]), parseInt(n[1])]);
                    break;
                  default:
                    (_[0] = e._CSSTOVALUE[c]) || (_[0] = c);
                }
                s.push(_);
              }
            }
            return s;
          }),
          (e.parseCSS = function (t, i) {
            for (var n; null != (n = e._parseCSSRegExp.exec(t)); )
              e.styleSheets[n[1]] = e.parseOneCSS(n[2], ";");
          }),
          (e.EMPTY = new e(null)),
          (e._CSSTOVALUE = {
            "letter-spacing": "letterSpacing",
            "line-spacing": "lineSpacing",
            "white-space": "whiteSpace",
            "line-height": "lineHeight",
            "scale-x": "scaleX",
            "scale-y": "scaleY",
            "translate-x": "translateX",
            "translate-y": "translateY",
            "font-family": "fontFamily",
            "font-weight": "fontWeight",
            "vertical-align": "valign",
            "text-decoration": "textDecoration",
            "background-color": "backgroundColor",
            "border-color": "borderColor",
            float: "cssFloat",
          }),
          (e._parseCSSRegExp = new RegExp("([.#]\\w+)\\s*{([\\s\\S]*?)}", "g")),
          (e._aligndef = {
            left: 0,
            center: 1,
            right: 2,
            0: "left",
            1: "center",
            2: "right",
          }),
          (e._valigndef = {
            top: 0,
            middle: 1,
            bottom: 2,
            0: "top",
            1: "middle",
            2: "bottom",
          }),
          (e.styleSheets = {}),
          (e.ALIGN_CENTER = 1),
          (e.ALIGN_RIGHT = 2),
          (e.VALIGN_MIDDLE = 1),
          (e.VALIGN_BOTTOM = 2),
          (e._CSS_BLOCK = 1),
          (e._DISPLAY_NONE = 2),
          (e._ABSOLUTE = 4),
          (e._WIDTH_SET = 8),
          (e._PADDING = [0, 0, 0, 0]),
          (e._RECT = [-1, -1, -1, -1]),
          (e._SPACING = [0, 0]),
          (e._ALIGNS = [0, 0, 0]),
          (e.ADDLAYOUTED = 512),
          (e._NEWFONT = 4096),
          (e._HEIGHT_SET = 8192),
          (e._BACKGROUND_SET = 16384),
          (e._FLOAT_RIGHT = 32768),
          (e._LINE_ELEMENT = 65536),
          (e._NOWARP = 131072),
          (e._WIDTHAUTO = 262144),
          (e._LISTERRESZIE = 524288),
          e
        );
      })(Style),
      AudioSound = (function (t) {
        function e() {
          (this.url = null),
            (this.audio = null),
            (this.loaded = !1),
            e.__super.call(this);
        }
        __class(e, "laya.media.h5audio.AudioSound", EventDispatcher);
        var i = e.prototype;
        return (
          (i.dispose = function () {
            var t = e._audioCache[this.url];
            t && ((t.src = ""), delete e._audioCache[this.url]);
          }),
          (i.load = function (t) {
            function i() {
              s(), (a.loaded = !0), a.event("complete");
            }
            function n() {
              (r.load = null), s(), a.event("error");
            }
            function s() {
              r.removeEventListener("canplaythrough", i),
                r.removeEventListener("error", n);
            }
            (t = URL.formatURL(t)), (this.url = t);
            var r;
            if (
              (t == SoundManager._tMusic
                ? (e._initMusicAudio(),
                  (r = e._musicAudio).src != t &&
                    ((e._audioCache[r.src] = null), (r = null)))
                : (r = e._audioCache[t]),
              r && r.readyState >= 2)
            )
              this.event("complete");
            else {
              r ||
                (t == SoundManager._tMusic
                  ? (e._initMusicAudio(), (r = e._musicAudio))
                  : (r = Browser.createElement("audio")),
                (e._audioCache[t] = r),
                (r.src = t)),
                r.addEventListener("canplaythrough", i),
                r.addEventListener("error", n);
              var a = this;
              (this.audio = r), r.load ? r.load() : n();
            }
          }),
          (i.play = function (t, i) {
            if ((void 0 === t && (t = 0), void 0 === i && (i = 0), !this.url))
              return null;
            var n;
            if (
              !(n =
                this.url == SoundManager._tMusic
                  ? e._musicAudio
                  : e._audioCache[this.url])
            )
              return null;
            var s;
            (s = Pool.getItem("audio:" + this.url)),
              Render.isConchApp
                ? s || ((s = Browser.createElement("audio")).src = this.url)
                : this.url == SoundManager._tMusic
                ? (e._initMusicAudio(), ((s = e._musicAudio).src = this.url))
                : (s = s || n.cloneNode(!0));
            var r = new AudioSoundChannel(s);
            return (
              (r.url = this.url),
              (r.loops = i),
              (r.startTime = t),
              r.play(),
              SoundManager.addChannel(r),
              r
            );
          }),
          __getset(0, i, "duration", function () {
            var t;
            return (t = e._audioCache[this.url]) ? t.duration : 0;
          }),
          (e._initMusicAudio = function () {
            e._musicAudio ||
              (e._musicAudio ||
                (e._musicAudio = Browser.createElement("audio")),
              Render.isConchApp ||
                Browser.document.addEventListener("mousedown", e._makeMusicOK));
          }),
          (e._makeMusicOK = function () {
            Browser.document.removeEventListener("mousedown", e._makeMusicOK),
              e._musicAudio.src
                ? e._musicAudio.play()
                : ((e._musicAudio.src = ""), e._musicAudio.load());
          }),
          (e._audioCache = {}),
          (e._musicAudio = null),
          e
        );
      })(),
      SoundChannel = (function (t) {
        function e() {
          (this.url = null),
            (this.loops = 0),
            (this.startTime = NaN),
            (this.isStopped = !1),
            (this.completeHandler = null),
            e.__super.call(this);
        }
        __class(e, "laya.media.SoundChannel", EventDispatcher);
        var i = e.prototype;
        return (
          (i.play = function () {}),
          (i.stop = function () {}),
          (i.pause = function () {}),
          (i.resume = function () {}),
          (i.__runComplete = function (t) {
            t && t.run();
          }),
          __getset(
            0,
            i,
            "volume",
            function () {
              return 1;
            },
            function (t) {}
          ),
          __getset(0, i, "position", function () {
            return 0;
          }),
          __getset(0, i, "duration", function () {
            return 0;
          }),
          e
        );
      })(),
      Sound = (function (t) {
        function e() {
          e.__super.call(this);
        }
        __class(e, "laya.media.Sound", EventDispatcher);
        var i = e.prototype;
        return (
          (i.load = function (t) {}),
          (i.play = function (t, e) {
            return void 0 === t && (t = 0), void 0 === e && (e = 0), null;
          }),
          (i.dispose = function () {}),
          __getset(0, i, "duration", function () {
            return 0;
          }),
          e
        );
      })(),
      WebAudioSound = (function (t) {
        function e() {
          (this.url = null),
            (this.loaded = !1),
            (this.data = null),
            (this.audioBuffer = null),
            (this.__toPlays = null),
            e.__super.call(this);
        }
        __class(e, "laya.media.webaudio.WebAudioSound", EventDispatcher);
        var i = e.prototype;
        return (
          (i.load = function (t) {
            var i = this;
            if (
              ((t = URL.formatURL(t)),
              (this.url = t),
              (this.audioBuffer = e._dataCache[t]),
              this.audioBuffer)
            )
              this._loaded(this.audioBuffer);
            else if (
              (e.e.on("loaded:" + t, this, this._loaded),
              e.e.on("err:" + t, this, this._err),
              !e.__loadingSound[t])
            ) {
              e.__loadingSound[t] = !0;
              var n = new Browser.window.XMLHttpRequest();
              n.open("GET", t, !0),
                (n.responseType = "arraybuffer"),
                (n.onload = function () {
                  (i.data = n.response),
                    e.buffs.push({ buffer: i.data, url: i.url }),
                    e.decode();
                }),
                (n.onerror = function (t) {
                  i._err();
                }),
                n.send();
            }
          }),
          (i._err = function () {
            this._removeLoadEvents(),
              (e.__loadingSound[this.url] = !1),
              this.event("error");
          }),
          (i._loaded = function (t) {
            this._removeLoadEvents(),
              (this.audioBuffer = t),
              (e._dataCache[this.url] = this.audioBuffer),
              (this.loaded = !0),
              this.event("complete");
          }),
          (i._removeLoadEvents = function () {
            e.e.off("loaded:" + this.url, this, this._loaded),
              e.e.off("err:" + this.url, this, this._err);
          }),
          (i.__playAfterLoaded = function () {
            if (this.__toPlays) {
              var t,
                e = 0,
                i = 0;
              i = (t = this.__toPlays).length;
              var n;
              for (e = 0; e < i; e++)
                (n = t[e])[2] && !n[2].isStopped && this.play(n[0], n[1], n[2]);
              this.__toPlays.length = 0;
            }
          }),
          (i.play = function (t, e, i) {
            return (
              void 0 === t && (t = 0),
              void 0 === e && (e = 0),
              (i = i || new WebAudioSoundChannel()),
              this.audioBuffer ||
                (this.url &&
                  (this.__toPlays || (this.__toPlays = []),
                  this.__toPlays.push([t, e, i]),
                  this.once("complete", this, this.__playAfterLoaded),
                  this.load(this.url))),
              (i.url = this.url),
              (i.loops = e),
              (i.audioBuffer = this.audioBuffer),
              (i.startTime = t),
              i.play(),
              SoundManager.addChannel(i),
              i
            );
          }),
          (i.dispose = function () {
            delete e._dataCache[this.url],
              delete e.__loadingSound[this.url],
              (this.audioBuffer = null),
              (this.data = null),
              (this.__toPlays = []);
          }),
          __getset(0, i, "duration", function () {
            return this.audioBuffer ? this.audioBuffer.duration : 0;
          }),
          (e.decode = function () {
            e.buffs.length <= 0 ||
              e.isDecoding ||
              ((e.isDecoding = !0),
              (e.tInfo = e.buffs.shift()),
              e.ctx.decodeAudioData(e.tInfo.buffer, e._done, e._fail));
          }),
          (e._done = function (t) {
            e.e.event("loaded:" + e.tInfo.url, t),
              (e.isDecoding = !1),
              e.decode();
          }),
          (e._fail = function () {
            e.e.event("err:" + e.tInfo.url, null),
              (e.isDecoding = !1),
              e.decode();
          }),
          (e._playEmptySound = function () {
            if (null != e.ctx) {
              var t = e.ctx.createBufferSource();
              (t.buffer = e._miniBuffer),
                t.connect(e.ctx.destination),
                t.start(0, 0, 0);
            }
          }),
          (e._unlock = function () {
            e._unlocked ||
              (e._playEmptySound(),
              "running" == e.ctx.state &&
                (Browser.document.removeEventListener(
                  "mousedown",
                  e._unlock,
                  !0
                ),
                Browser.document.removeEventListener("touchend", e._unlock, !0),
                (e._unlocked = !0)));
          }),
          (e.initWebAudio = function () {
            "running" != e.ctx.state &&
              (e._unlock(),
              Browser.document.addEventListener("mousedown", e._unlock, !0),
              Browser.document.addEventListener("touchend", e._unlock, !0));
          }),
          (e._dataCache = {}),
          (e.buffs = []),
          (e.isDecoding = !1),
          (e._unlocked = !1),
          (e.tInfo = null),
          (e.__loadingSound = {}),
          __static(e, [
            "window",
            function () {
              return (this.window = Browser.window);
            },
            "webAudioEnabled",
            function () {
              return (this.webAudioEnabled =
                e.window.AudioContext ||
                e.window.webkitAudioContext ||
                e.window.mozAudioContext);
            },
            "ctx",
            function () {
              return (this.ctx = e.webAudioEnabled
                ? new (e.window.AudioContext ||
                    e.window.webkitAudioContext ||
                    e.window.mozAudioContext)()
                : void 0);
            },
            "_miniBuffer",
            function () {
              return (this._miniBuffer = e.ctx.createBuffer(1, 1, 22050));
            },
            "e",
            function () {
              return (this.e = new EventDispatcher());
            },
          ]),
          e
        );
      })(),
      HttpRequest = (function (t) {
        function e() {
          (this._responseType = null),
            (this._data = null),
            e.__super.call(this),
            (this._http = new Browser.window.XMLHttpRequest());
        }
        __class(e, "laya.net.HttpRequest", EventDispatcher);
        var i = e.prototype;
        return (
          (i.send = function (t, e, i, n, s) {
            void 0 === i && (i = "get"),
              void 0 === n && (n = "text"),
              (this._responseType = n),
              (this._data = null);
            var r = this,
              a = this._http;
            if ((a.open(i, t, !0), s))
              for (var o = 0; o < s.length; o++)
                a.setRequestHeader(s[o++], s[o]);
            else
              Render.isConchApp ||
                (e && "string" != typeof e
                  ? a.setRequestHeader("Content-Type", "application/json")
                  : a.setRequestHeader(
                      "Content-Type",
                      "application/x-www-form-urlencoded"
                    ));
            (a.responseType = "arraybuffer" !== n ? "text" : "arraybuffer"),
              (a.onerror = function (t) {
                r._onError(t);
              }),
              (a.onabort = function (t) {
                r._onAbort(t);
              }),
              (a.onprogress = function (t) {
                r._onProgress(t);
              }),
              (a.onload = function (t) {
                r._onLoad(t);
              }),
              a.send(e);
          }),
          (i._onProgress = function (t) {
            t &&
              t.lengthComputable &&
              this.event("progress", t.loaded / t.total);
          }),
          (i._onAbort = function (t) {
            this.error("Request was aborted by user");
          }),
          (i._onError = function (t) {
            this.error(
              "Request failed Status:" +
                this._http.status +
                " text:" +
                this._http.statusText
            );
          }),
          (i._onLoad = function (t) {
            var e = this._http,
              i = void 0 !== e.status ? e.status : 200;
            200 === i || 204 === i || 0 === i
              ? this.complete()
              : this.error(
                  "[" + e.status + "]" + e.statusText + ":" + e.responseURL
                );
          }),
          (i.error = function (t) {
            this.clear(), this.event("error", t);
          }),
          (i.complete = function () {
            this.clear();
            var t = !0;
            try {
              "json" === this._responseType
                ? (this._data = JSON.parse(this._http.responseText))
                : "xml" === this._responseType
                ? (this._data = Utils.parseXMLFromString(
                    this._http.responseText
                  ))
                : (this._data = this._http.response || this._http.responseText);
            } catch (e) {
              (t = !1), this.error(e.message);
            }
            t &&
              this.event(
                "complete",
                this._data instanceof Array ? [this._data] : this._data
              );
          }),
          (i.clear = function () {
            var t = this._http;
            t.onerror = t.onabort = t.onprogress = t.onload = null;
          }),
          __getset(0, i, "url", function () {
            return this._http.responseURL;
          }),
          __getset(0, i, "http", function () {
            return this._http;
          }),
          __getset(0, i, "data", function () {
            return this._data;
          }),
          e
        );
      })(),
      Loader = (function (t) {
        function e() {
          (this._data = null),
            (this._class = null),
            (this._url = null),
            (this._type = null),
            (this._cache = !1),
            (this._http = null),
            (this._customParse = !1),
            e.__super.call(this);
        }
        __class(e, "laya.net.Loader", EventDispatcher);
        var i = e.prototype;
        return (
          (i.load = function (t, i, n, s, r) {
            if (
              (void 0 === n && (n = !0),
              void 0 === r && (r = !1),
              (this._url = t),
              0 === t.indexOf("data:image")
                ? (this._type = i = "image")
                : ((this._type = i || (i = this.getTypeFromUrl(t))),
                  (t = URL.formatURL(t))),
              (this._cache = n),
              (this._data = null),
              !r && e.loadedMap[t])
            )
              return (
                (this._data = e.loadedMap[t]),
                this.event("progress", 1),
                void this.event("complete", this._data)
              );
            if ((s && e.setGroup(t, s), null != e.parserMap[i]))
              return (
                (this._customParse = !0),
                void (e.parserMap[i] instanceof laya.utils.Handler
                  ? e.parserMap[i].runWith(this)
                  : e.parserMap[i].call(null, this))
              );
            if ("image" === i || "htmlimage" === i || "nativeimage" === i)
              return this._loadImage(t);
            if ("sound" === i) return this._loadSound(t);
            if ("ttf" === i) return this._loadTTF(t);
            if ("atlas" == i && e.preLoadedAtlasConfigMap[t])
              return (
                this.onLoaded(e.preLoadedAtlasConfigMap[t]),
                void delete e.preLoadedAtlasConfigMap[t]
              );
            this._http ||
              ((this._http = new HttpRequest()),
              this._http.on("progress", this, this.onProgress),
              this._http.on("error", this, this.onError),
              this._http.on("complete", this, this.onLoaded));
            var a;
            switch (i) {
              case "atlas":
                a = "json";
                break;
              case "font":
                a = "xml";
                break;
              case "pkm":
                a = "arraybuffer";
                break;
              default:
                a = i;
            }
            this._http.send(t, null, "get", a);
          }),
          (i.getTypeFromUrl = function (t) {
            var i = Utils.getFileExtension(t);
            return i
              ? e.typeMap[i]
              : (console.warn("Not recognize the resources suffix", t), "text");
          }),
          (i._loadTTF = function (t) {
            t = URL.formatURL(t);
            var e = new TTFLoader();
            (e.complete = Handler.create(this, this.onLoaded)), e.load(t);
          }),
          (i._loadImage = function (t) {
            function i() {
              (n.onload = null), (n.onerror = null), delete e.imgCache[t];
            }
            t = URL.formatURL(t);
            var n,
              s = this,
              r = function () {
                i(), s.onLoaded(n);
              },
              a = function () {
                i(), s.event("error", "Load image failed");
              };
            "nativeimage" === this._type
              ? (((n = new Browser.window.Image()).crossOrigin = ""),
                (n.onload = r),
                (n.onerror = a),
                (n.src = t),
                (e.imgCache[t] = n))
              : new HTMLImage.create(t, {
                  onload: r,
                  onerror: a,
                  onCreate: function (i) {
                    (n = i), (e.imgCache[t] = i);
                  },
                });
          }),
          (i._loadSound = function (t) {
            function e() {
              i.offAll();
            }
            var i = new SoundManager._soundClass(),
              n = this;
            i.on("complete", this, function () {
              e(), n.onLoaded(i);
            }),
              i.on("error", this, function () {
                e(), i.dispose(), n.event("error", "Load sound failed");
              }),
              i.load(t);
          }),
          (i.onProgress = function (t) {
            "atlas" === this._type
              ? this.event("progress", 0.3 * t)
              : this.event("progress", t);
          }),
          (i.onError = function (t) {
            this.event("error", t);
          }),
          (i.onLoaded = function (t) {
            var i = this._type;
            if ("image" === i) {
              var n = new Texture(t);
              (n.url = this._url), this.complete(n);
            } else if (
              "sound" === i ||
              "htmlimage" === i ||
              "nativeimage" === i
            )
              this.complete(t);
            else if ("atlas" === i) {
              if (!t.src && !t._setContext) {
                if (!this._data) {
                  if (((this._data = t), t.meta && t.meta.image))
                    for (
                      var s = t.meta.image.split(","),
                        r = this._url.indexOf("/") >= 0 ? "/" : "\\",
                        a = this._url.lastIndexOf(r),
                        o = a >= 0 ? this._url.substr(0, a + 1) : "",
                        h = 0,
                        l = s.length;
                      h < l;
                      h++
                    )
                      s[h] = o + s[h];
                  else s = [this._url.replace(".json", ".png")];
                  s.reverse(), (t.toLoads = s), (t.pics = []);
                }
                return (
                  this.event("progress", 0.3 + (1 / s.length) * 0.6),
                  this._loadImage(s.pop())
                );
              }
              if ((this._data.pics.push(t), this._data.toLoads.length > 0))
                return (
                  this.event(
                    "progress",
                    0.3 + (1 / this._data.toLoads.length) * 0.6
                  ),
                  this._loadImage(this._data.toLoads.pop())
                );
              var c = this._data.frames,
                u = this._url.split("?")[0],
                _ =
                  this._data.meta && this._data.meta.prefix
                    ? this._data.meta.prefix
                    : u.substring(0, u.lastIndexOf(".")) + "/",
                d = this._data.pics,
                f = URL.formatURL(this._url),
                p = e.atlasMap[f] || (e.atlasMap[f] = []);
              p.dir = _;
              var g = 1;
              if (
                this._data.meta &&
                this._data.meta.scale &&
                1 != this._data.meta.scale
              ) {
                g = parseFloat(this._data.meta.scale);
                for (var m in c) {
                  var v = c[m],
                    y = d[v.frame.idx ? v.frame.idx : 0],
                    w = URL.formatURL(_ + m);
                  (y.scaleRate = g),
                    e.cacheRes(
                      w,
                      Texture.create(
                        y,
                        v.frame.x,
                        v.frame.y,
                        v.frame.w,
                        v.frame.h,
                        v.spriteSourceSize.x,
                        v.spriteSourceSize.y,
                        v.sourceSize.w,
                        v.sourceSize.h
                      )
                    ),
                    (e.loadedMap[w].url = w),
                    p.push(w);
                }
              } else
                for (m in c)
                  (y = d[(v = c[m]).frame.idx ? v.frame.idx : 0]),
                    (w = URL.formatURL(_ + m)),
                    e.cacheRes(
                      w,
                      Texture.create(
                        y,
                        v.frame.x,
                        v.frame.y,
                        v.frame.w,
                        v.frame.h,
                        v.spriteSourceSize.x,
                        v.spriteSourceSize.y,
                        v.sourceSize.w,
                        v.sourceSize.h
                      )
                    ),
                    (e.loadedMap[w].url = w),
                    p.push(w);
              delete this._data.pics, this.complete(this._data);
            } else if ("font" == i) {
              if (!t.src)
                return (
                  (this._data = t),
                  this.event("progress", 0.5),
                  this._loadImage(this._url.replace(".fnt", ".png"))
                );
              var x = new BitmapFont();
              x.parseFont(this._data, t);
              var T = this._url.split(".fnt")[0].split("/"),
                b = T[T.length - 1];
              Text.registerBitmapFont(b, x),
                (this._data = x),
                this.complete(this._data);
            } else if ("pkm" == i) {
              var C = HTMLImage.create(t, this._url),
                M = new Texture(C);
              (M.url = this._url), this.complete(M);
            } else this.complete(t);
          }),
          (i.complete = function (t) {
            (this._data = t),
              this._customParse
                ? this.event("loaded", t instanceof Array ? [t] : t)
                : (e._loaders.push(this), e._isWorking || e.checkNext());
          }),
          (i.endLoad = function (t) {
            t && (this._data = t),
              this._cache && e.cacheRes(this._url, this._data),
              (this._customParse = !1),
              this.event("progress", 1),
              this.event(
                "complete",
                this.data instanceof Array ? [this.data] : this.data
              );
          }),
          __getset(0, i, "url", function () {
            return this._url;
          }),
          __getset(0, i, "data", function () {
            return this._data;
          }),
          __getset(0, i, "cache", function () {
            return this._cache;
          }),
          __getset(0, i, "type", function () {
            return this._type;
          }),
          (e.checkNext = function () {
            e._isWorking = !0;
            for (var t = Browser.now(); e._startIndex < e._loaders.length; )
              if (
                (Browser.now(),
                e._loaders[e._startIndex].endLoad(),
                e._startIndex++,
                Browser.now() - t > e.maxTimeOut)
              )
                return (
                  console.warn(
                    "loader callback cost a long time:" +
                      (Browser.now() - t) +
                      " url=" +
                      e._loaders[e._startIndex - 1].url
                  ),
                  void Laya.timer.frameOnce(1, null, e.checkNext)
                );
            (e._loaders.length = 0), (e._startIndex = 0), (e._isWorking = !1);
          }),
          (e.clearRes = function (t, i) {
            void 0 === i && (i = !1), (t = URL.formatURL(t));
            var n = e.getAtlas(t);
            if (n) {
              for (var s = 0, r = n.length; s < r; s++) {
                var a = n[s],
                  o = e.getRes(a);
                delete e.loadedMap[a], o && o.destroy(i);
              }
              (n.length = 0), delete e.atlasMap[t], delete e.loadedMap[t];
            } else {
              var h = e.loadedMap[t];
              h &&
                (delete e.loadedMap[t],
                h instanceof laya.resource.Texture && h.bitmap && h.destroy(i));
            }
          }),
          (e.clearTextureRes = function (t) {
            t = URL.formatURL(t);
            var e = laya.net.Loader.getAtlas(t),
              i =
                e && e.length > 0
                  ? laya.net.Loader.getRes(e[0])
                  : laya.net.Loader.getRes(t);
            i &&
              i.bitmap &&
              (Render.isConchApp
                ? i.bitmap.source.releaseTexture &&
                  i.bitmap.source.releaseTexture()
                : null == i.bitmap._atlaser && i.bitmap.releaseResource(!0));
          }),
          (e.setAtlasConfigs = function (t, i) {
            e.preLoadedAtlasConfigMap[URL.formatURL(t)] = i;
          }),
          (e.getRes = function (t) {
            return e.loadedMap[URL.formatURL(t)];
          }),
          (e.getAtlas = function (t) {
            return e.atlasMap[URL.formatURL(t)];
          }),
          (e.cacheRes = function (t, i) {
            (t = URL.formatURL(t)),
              null != e.loadedMap[t]
                ? console.warn(
                    "Resources already exist,is repeated loading:",
                    t
                  )
                : (e.loadedMap[t] = i);
          }),
          (e.setGroup = function (t, i) {
            e.groupMap[i] || (e.groupMap[i] = []), e.groupMap[i].push(t);
          }),
          (e.clearResByGroup = function (t) {
            if (e.groupMap[t]) {
              var i = e.groupMap[t],
                n = 0,
                s = i.length;
              for (n = 0; n < s; n++) e.clearRes(i[n]);
              i.length = 0;
            }
          }),
          (e.TEXT = "text"),
          (e.JSON = "json"),
          (e.XML = "xml"),
          (e.BUFFER = "arraybuffer"),
          (e.IMAGE = "image"),
          (e.SOUND = "sound"),
          (e.ATLAS = "atlas"),
          (e.FONT = "font"),
          (e.TTF = "ttf"),
          (e.PKM = "pkm"),
          (e.typeMap = {
            png: "image",
            jpg: "image",
            jpeg: "image",
            txt: "text",
            json: "json",
            xml: "xml",
            als: "atlas",
            atlas: "atlas",
            mp3: "sound",
            ogg: "sound",
            wav: "sound",
            part: "json",
            fnt: "font",
            pkm: "pkm",
            ttf: "ttf",
          }),
          (e.parserMap = {}),
          (e.groupMap = {}),
          (e.maxTimeOut = 100),
          (e.loadedMap = {}),
          (e.preLoadedAtlasConfigMap = {}),
          (e.atlasMap = {}),
          (e._loaders = []),
          (e._isWorking = !1),
          (e._startIndex = 0),
          (e.imgCache = {}),
          e
        );
      })(),
      LoaderManager = (function (t) {
        function e() {
          (this.retryNum = 1),
            (this.retryDelay = 0),
            (this.maxLoader = 5),
            (this._loaders = []),
            (this._loaderCount = 0),
            (this._resInfos = []),
            (this._infoPool = []),
            (this._maxPriority = 5),
            (this._failRes = {}),
            e.__super.call(this);
          for (var t = 0; t < this._maxPriority; t++) this._resInfos[t] = [];
        }
        var i;
        __class(e, "laya.net.LoaderManager", EventDispatcher);
        var n = e.prototype;
        return (
          (n.create = function (t, e, i, n, s, r, a, o) {
            if (
              (void 0 === r && (r = 1),
              void 0 === a && (a = !0),
              t instanceof Array)
            ) {
              var h = t,
                l = h.length,
                c = 0;
              if (i) var u = Handler.create(i.caller, i.method, i.args, !1);
              for (var _ = 0; _ < l; _++) {
                var d = h[_];
                "string" == typeof d && (d = h[_] = { url: d }),
                  (d.progress = 0);
                var f = i
                    ? Handler.create(
                        null,
                        function (t, e) {
                          t.progress = e;
                          for (var i = 0, n = 0; n < l; n++) i += h[n].progress;
                          var s = i / l;
                          u.runWith(s);
                        },
                        [d],
                        !1
                      )
                    : null,
                  p =
                    i || e
                      ? Handler.create(
                          null,
                          function (t, i) {
                            c++, (t.progress = 1), c === l && e && e.run();
                          },
                          [d]
                        )
                      : null;
                this._create(
                  d.url,
                  p,
                  f,
                  d.clas || n,
                  d.params || s,
                  d.priority || r,
                  a,
                  d.group || o
                );
              }
              return !0;
            }
            return this._create(t, e, i, n, s, r, a, o);
          }),
          (n._create = function (t, i, n, s, r, a, o, h) {
            void 0 === a && (a = 1), void 0 === o && (o = !0);
            var l = URL.formatURL(t),
              c = this.getRes(l);
            if (c)
              !c.hasOwnProperty("loaded") || c.loaded
                ? (n && n.runWith(1), i && i.run())
                : i &&
                  Laya.loader._createListener(
                    t,
                    i.caller,
                    i.method,
                    i.args,
                    !0,
                    !1
                  );
            else {
              var u = Utils.getFileExtension(t),
                _ = e.createMap[u];
              if (!_)
                throw new Error(
                  "LoaderManager:unknown file(" +
                    t +
                    ") extension with: " +
                    u +
                    "."
                );
              s || (s = _[0]);
              var d = _[1];
              "atlas" == u
                ? this.load(t, i, n, d, a, o)
                : (s === Texture && (d = "htmlimage"),
                  (c = s ? new s() : null).hasOwnProperty("_loaded") &&
                    (c._loaded = !1),
                  c._setUrl(t),
                  h && c._setGroup(h),
                  this._createLoad(
                    c,
                    t,
                    Handler.create(null, function (e) {
                      c && !c.destroyed && e && c.onAsynLoaded.call(c, t, e, r),
                        i && i.run(),
                        Laya.loader.event(t);
                    }),
                    n,
                    d,
                    a,
                    !1,
                    h,
                    !0
                  ),
                  o && this.cacheRes(l, c));
            }
            return c;
          }),
          (n.load = function (t, n, s, r, a, o, h, l) {
            var c = this;
            if (
              (void 0 === a && (a = 1),
              void 0 === o && (o = !0),
              void 0 === l && (l = !1),
              t instanceof Array)
            )
              return this._loadAssets(t, n, s, r, a, o, h);
            var u = Loader.getRes(t);
            if (null != u)
              Laya.timer.frameOnce(1, null, function () {
                s && s.runWith(1),
                  n && n.runWith(u),
                  c._loaderCount || c.event("complete");
              });
            else {
              var _ = e._resMap[t];
              _
                ? (n &&
                    _._createListener(
                      "complete",
                      n.caller,
                      n.method,
                      n.args,
                      !1,
                      !1
                    ),
                  s &&
                    _._createListener(
                      "progress",
                      s.caller,
                      s.method,
                      s.args,
                      !1,
                      !1
                    ))
                : (((_ = this._infoPool.length
                    ? this._infoPool.pop()
                    : new i()).url = t),
                  (_.type = r),
                  (_.cache = o),
                  (_.group = h),
                  (_.ignoreCache = l),
                  n && _.on("complete", n.caller, n.method, n.args),
                  s && _.on("progress", s.caller, s.method, s.args),
                  (e._resMap[t] = _),
                  (a = a < this._maxPriority ? a : this._maxPriority - 1),
                  this._resInfos[a].push(_),
                  this._next());
            }
            return this;
          }),
          (n._createLoad = function (t, n, s, r, a, o, h, l, c) {
            var u = this;
            if (
              (void 0 === o && (o = 1),
              void 0 === h && (h = !0),
              void 0 === c && (c = !1),
              n instanceof Array)
            )
              return this._loadAssets(n, s, r, a, o, h, l);
            var _ = Loader.getRes(n);
            if (null != _)
              Laya.timer.frameOnce(1, null, function () {
                r && r.runWith(1),
                  s && s.runWith(_),
                  u._loaderCount || u.event("complete");
              });
            else {
              var d = e._resMap[n];
              d
                ? (s &&
                    d._createListener(
                      "complete",
                      s.caller,
                      s.method,
                      s.args,
                      !1,
                      !1
                    ),
                  r &&
                    d._createListener(
                      "progress",
                      r.caller,
                      r.method,
                      r.args,
                      !1,
                      !1
                    ))
                : (((d = this._infoPool.length
                    ? this._infoPool.pop()
                    : new i()).url = n),
                  (d.clas = t),
                  (d.type = a),
                  (d.cache = h),
                  (d.group = l),
                  (d.ignoreCache = c),
                  s && d.on("complete", s.caller, s.method, s.args),
                  r && d.on("progress", r.caller, r.method, r.args),
                  (e._resMap[n] = d),
                  (o = o < this._maxPriority ? o : this._maxPriority - 1),
                  this._resInfos[o].push(d),
                  this._next());
            }
            return this;
          }),
          (n._next = function () {
            if (!(this._loaderCount >= this.maxLoader)) {
              for (var t = 0; t < this._maxPriority; t++)
                for (var e = this._resInfos[t]; e.length > 0; ) {
                  var i = e.shift();
                  if (i) return this._doLoad(i);
                }
              this._loaderCount || this.event("complete");
            }
          }),
          (n._doLoad = function (t) {
            function e(e) {
              i.offAll(),
                (i._data = null),
                n._loaders.push(i),
                n._endLoad(t, e instanceof Array ? [e] : e),
                n._loaderCount--,
                n._next();
            }
            this._loaderCount++;
            var i = this._loaders.length ? this._loaders.pop() : new Loader();
            i.on("complete", null, e),
              i.on("progress", null, function (e) {
                t.event("progress", e);
              }),
              i.on("error", null, function (t) {
                e(null);
              });
            var n = this;
            (i._class = t.clas),
              i.load(t.url, t.type, t.cache, t.group, t.ignoreCache);
          }),
          (n._endLoad = function (t, i) {
            var n = t.url;
            if (null == i) {
              var s = this._failRes[n] || 0;
              if (s < this.retryNum)
                return (
                  console.warn("[warn]Retry to load:", n),
                  (this._failRes[n] = s + 1),
                  void Laya.timer.once(
                    this.retryDelay,
                    this,
                    this._addReTry,
                    [t],
                    !1
                  )
                );
              console.warn("[error]Failed to load:", n), this.event("error", n);
            }
            this._failRes[n] && (this._failRes[n] = 0),
              delete e._resMap[n],
              t.event("complete", i),
              t.offAll(),
              this._infoPool.push(t);
          }),
          (n._addReTry = function (t) {
            this._resInfos[this._maxPriority - 1].push(t), this._next();
          }),
          (n.clearRes = function (t, e) {
            void 0 === e && (e = !1), Loader.clearRes(t, e);
          }),
          (n.getRes = function (t) {
            return Loader.getRes(t);
          }),
          (n.cacheRes = function (t, e) {
            Loader.cacheRes(t, e);
          }),
          (n.clearTextureRes = function (t) {
            Loader.clearTextureRes(t);
          }),
          (n.setGroup = function (t, e) {
            Loader.setGroup(t, e);
          }),
          (n.clearResByGroup = function (t) {
            Loader.clearResByGroup(t);
          }),
          (n.clearUnLoaded = function () {
            for (var t = 0; t < this._maxPriority; t++) {
              for (var i = this._resInfos[t], n = i.length - 1; n > -1; n--) {
                var s = i[n];
                s && (s.offAll(), this._infoPool.push(s));
              }
              i.length = 0;
            }
            (this._loaderCount = 0), (e._resMap = {});
          }),
          (n.cancelLoadByUrls = function (t) {
            if (t)
              for (var e = 0, i = t.length; e < i; e++)
                this.cancelLoadByUrl(t[e]);
          }),
          (n.cancelLoadByUrl = function (t) {
            for (var i = 0; i < this._maxPriority; i++)
              for (var n = this._resInfos[i], s = n.length - 1; s > -1; s--) {
                var r = n[s];
                r &&
                  r.url === t &&
                  ((n[s] = null), r.offAll(), this._infoPool.push(r));
              }
            e._resMap[t] && delete e._resMap[t];
          }),
          (n._loadAssets = function (t, e, i, n, s, r, a) {
            void 0 === s && (s = 1), void 0 === r && (r = !0);
            for (
              var o = t.length, h = 0, l = 0, c = [], u = !0, _ = 0;
              _ < o;
              _++
            ) {
              var d = t[_];
              "string" == typeof d &&
                (d = { url: d, type: n, size: 1, priority: s }),
                d.size || (d.size = 1),
                (d.progress = 0),
                (l += d.size),
                c.push(d);
              var f = i
                  ? Handler.create(
                      null,
                      function (t, e) {
                        if (null != i) {
                          t.progress = e;
                          for (var n = 0, s = 0; s < c.length; s++) {
                            var r = c[s];
                            n += r.size * r.progress;
                          }
                          var a = n / l;
                          i.runWith(a);
                        }
                      },
                      [d],
                      !1
                    )
                  : null,
                p =
                  e || i
                    ? Handler.create(
                        null,
                        function (t, i) {
                          h++,
                            (t.progress = 1),
                            i || (u = !1),
                            h === o && e && e.runWith(u);
                        },
                        [d]
                      )
                    : null;
              this.load(d.url, p, f, d.type, d.priority || 1, r, d.group || a);
            }
            return this;
          }),
          (e.cacheRes = function (t, e) {
            Loader.cacheRes(t, e);
          }),
          (e._resMap = {}),
          __static(e, [
            "createMap",
            function () {
              return (this.createMap = { atlas: [null, "atlas"] });
            },
          ]),
          (e.__init$ = function () {
            i = (function (t) {
              function e() {
                (this.url = null),
                  (this.type = null),
                  (this.cache = !1),
                  (this.group = null),
                  (this.ignoreCache = !1),
                  (this.clas = null),
                  e.__super.call(this);
              }
              return __class(e, "", EventDispatcher), e;
            })();
          }),
          e
        );
      })(),
      ColorFilter = (function (t) {
        function e(t) {
          e.__super.call(this),
            t ||
              (t = [
                0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11,
                0, 0, 0, 0, 0, 1, 0,
              ]),
            (this._mat = new Float32Array(16)),
            (this._alpha = new Float32Array(4));
          for (var i = 0, n = 0, s = 0; s < 20; s++)
            s % 5 != 4 ? (this._mat[i++] = t[s]) : (this._alpha[n++] = t[s]);
          (this._action = RunDriver.createFilterAction(32)),
            (this._action.data = this);
        }
        __class(e, "laya.filters.ColorFilter", Filter);
        var i = e.prototype;
        return (
          Laya.imps(i, { "laya.filters.IFilter": !0 }),
          (i.callNative = function (t) {
            t._$P.cf = this;
            t.conchModel &&
              t.conchModel.setFilterMatrix &&
              t.conchModel.setFilterMatrix(this._mat, this._alpha);
          }),
          __getset(0, i, "type", function () {
            return 32;
          }),
          __getset(0, i, "action", function () {
            return this._action;
          }),
          e
        );
      })(),
      Socket = (function (t) {
        function e(t, i, n) {
          (this._endian = null),
            (this._stamp = NaN),
            (this._socket = null),
            (this._connected = !1),
            (this._addInputPosition = 0),
            (this._input = null),
            (this._output = null),
            (this.timeout = 0),
            (this.objectEncoding = 0),
            (this.disableInput = !1),
            (this._byteClass = null),
            (this.protocols = []),
            void 0 === i && (i = 0),
            e.__super.call(this),
            (this._byteClass = n || Byte),
            (this.endian = "bigEndian"),
            (this.timeout = 2e4),
            (this._addInputPosition = 0),
            t && i > 0 && i < 65535 && this.connect(t, i);
        }
        __class(e, "laya.net.Socket", EventDispatcher);
        var i = e.prototype;
        return (
          (i.connect = function (t, e) {
            var i = "ws://" + t + ":" + e;
            (i =
              "https:" == Browser.window.location.protocol
                ? "wss://" + t + ":" + e
                : "ws://" + t + ":" + e),
              this.connectByUrl(i);
          }),
          (i.connectByUrl = function (t) {
            var e = this;
            null != this._socket && this.close(),
              this._socket && this.cleanSocket(),
              this.protocols && 0 != this.protocols.length
                ? (this._socket = new Browser.window.WebSocket(
                    t,
                    this.protocols
                  ))
                : (this._socket = new Browser.window.WebSocket(t)),
              (this._socket.binaryType = "arraybuffer"),
              (this._output = new this._byteClass()),
              (this._output.endian = this.endian),
              (this._input = new this._byteClass()),
              (this._input.endian = this.endian),
              (this._addInputPosition = 0),
              (this._socket.onopen = function (t) {
                e._onOpen(t);
              }),
              (this._socket.onmessage = function (t) {
                e._onMessage(t);
              }),
              (this._socket.onclose = function (t) {
                e._onClose(t);
              }),
              (this._socket.onerror = function (t) {
                e._onError(t);
              });
          }),
          (i.cleanSocket = function () {
            try {
              this._socket.close();
            } catch (t) {}
            (this._connected = !1),
              (this._socket.onopen = null),
              (this._socket.onmessage = null),
              (this._socket.onclose = null),
              (this._socket.onerror = null),
              (this._socket = null);
          }),
          (i.close = function () {
            if (null != this._socket)
              try {
                this._socket.close();
              } catch (t) {}
          }),
          (i._onOpen = function (t) {
            (this._connected = !0), this.event("open", t);
          }),
          (i._onMessage = function (t) {
            if (t && t.data) {
              var e = t.data;
              if (this.disableInput && e) this.event("message", e);
              else {
                this._input.length > 0 &&
                  this._input.bytesAvailable < 1 &&
                  (this._input.clear(), (this._addInputPosition = 0));
                var i = this._input.pos;
                !this._addInputPosition && (this._addInputPosition = 0),
                  (this._input.pos = this._addInputPosition),
                  e &&
                    ("string" == typeof e
                      ? this._input.writeUTFBytes(e)
                      : this._input.writeArrayBuffer(e),
                    (this._addInputPosition = this._input.pos),
                    (this._input.pos = i)),
                  this.event("message", e);
              }
            }
          }),
          (i._onClose = function (t) {
            (this._connected = !1), this.event("close", t);
          }),
          (i._onError = function (t) {
            this.event("error", t);
          }),
          (i.send = function (t) {
            this._socket.send(t);
          }),
          (i.flush = function () {
            if (this._output && this._output.length > 0) {
              var t;
              try {
                this._socket &&
                  this._socket.send(
                    this._output.__getBuffer().slice(0, this._output.length)
                  );
              } catch (e) {
                t = e;
              }
              (this._output.endian = this.endian),
                this._output.clear(),
                t && this.event("error", t);
            }
          }),
          __getset(0, i, "input", function () {
            return this._input;
          }),
          __getset(0, i, "output", function () {
            return this._output;
          }),
          __getset(0, i, "connected", function () {
            return this._connected;
          }),
          __getset(
            0,
            i,
            "endian",
            function () {
              return this._endian;
            },
            function (t) {
              (this._endian = t),
                null != this._input && (this._input.endian = t),
                null != this._output && (this._output.endian = t);
            }
          ),
          (e.LITTLE_ENDIAN = "littleEndian"),
          (e.BIG_ENDIAN = "bigEndian"),
          e
        );
      })(),
      WorkerLoader = (function (t) {
        function e() {
          (this.worker = null), e.__super.call(this);
          var t = this;
          (this.worker = new Browser.window.Worker(e.workerPath)),
            (this.worker.onmessage = function (e) {
              t.workerMessage(e.data);
            });
        }
        __class(e, "laya.net.WorkerLoader", EventDispatcher);
        var i = e.prototype;
        return (
          (i.workerMessage = function (t) {
            if (t)
              switch (t.type) {
                case "Image":
                  this.imageLoaded(t);
                  break;
                case "Msg":
                  this.event("image_msg", t.msg);
              }
          }),
          (i.imageLoaded = function (t) {
            if (t && t.buffer && t.buffer.length < 10)
              return (
                (e._enable = !1),
                this._myTrace(
                  "buffer lost when postmessage ,disable workerloader"
                ),
                this.event(t.url, null),
                void this.event("image_err", t.url + "\n" + t.msg)
              );
            if (!t.dataType)
              return (
                this.event(t.url, null),
                void this.event("image_err", t.url + "\n" + t.msg)
              );
            var i, n, s;
            switch (t.dataType) {
              case "buffer":
                (s = (n = (i = new HTMLCanvas("2D")).source.getContext(
                  "2d"
                )).createImageData(t.width, t.height)).data.set(t.buffer),
                  i.size(s.width, s.height),
                  n.putImageData(s, 0, 0),
                  (i.memorySize = 0);
                break;
              case "imagedata":
                (n = (i = new HTMLCanvas("2D")).source.getContext("2d")),
                  (s = t.imagedata),
                  i.size(s.width, s.height),
                  n.putImageData(s, 0, 0),
                  (s = t.imagedata),
                  (i.memorySize = 0);
                break;
              case "imageBitmap":
                (s = t.imageBitmap),
                  Render.isWebGL
                    ? (i = s)
                    : ((n = (i = new HTMLCanvas("2D")).source.getContext("2d")),
                      i.size(s.width, s.height),
                      n.drawImage(s, 0, 0),
                      (i.src = t.url));
            }
            Render.isWebGL &&
              (i = new laya.webgl.resource.WebGLImage(i, t.url)),
              this.event(t.url, i);
          }),
          (i._myTrace = function (t) {
            var e = arguments,
              i = [],
              n = 0,
              s = e.length;
            for (n = 0; n < s; n++) i.push(e[n]);
            this.event("image_msg", i.join(" "));
          }),
          (i.loadImage = function (t) {
            var e;
            ((e = {}).type = "load"), (e.url = t), this.worker.postMessage(e);
          }),
          (i._loadImage = function (t) {
            var i = this;
            if (!e._enable || t.toLowerCase().indexOf(".png") < 0)
              e._preLoadFun.call(i, t);
            else {
              t = URL.formatURL(t);
              var n = function (s) {
                laya.net.WorkerLoader.I.off(t, i, n),
                  s ? i.onLoaded(s) : e._preLoadFun.call(i, t);
              };
              laya.net.WorkerLoader.I.on(t, i, n),
                laya.net.WorkerLoader.I.loadImage(t);
            }
          }),
          __getset(
            1,
            e,
            "enable",
            function () {
              return e._enable;
            },
            function (t) {
              (e.disableJSDecode && !Browser.window.createImageBitmap) ||
                ((e._enable = t) &&
                  null == e._preLoadFun &&
                  (e._enable = e.__init__()));
            }
          ),
          (e.__init__ = function () {
            return (
              null == e._preLoadFun &&
              !!Browser.window.Worker &&
              ((e._preLoadFun = Loader.prototype._loadImage),
              (Loader.prototype._loadImage = e.prototype._loadImage),
              e.I || (e.I = new e()),
              !0)
            );
          }),
          (e.workerSupported = function () {
            return !!Browser.window.Worker;
          }),
          (e.IMAGE_LOADED = "image_loaded"),
          (e.IMAGE_ERR = "image_err"),
          (e.IMAGE_MSG = "image_msg"),
          (e.I = null),
          (e._preLoadFun = null),
          (e._enable = !1),
          (e.workerPath = "libs/worker.js"),
          (e.disableJSDecode = !0),
          e
        );
      })(),
      Resource = (function (t) {
        function e() {
          e.__super.call(this),
            (this._$1__id = ++e._uniqueIDCounter),
            (this.__loaded = !0),
            (this._destroyed = !1),
            (this._referenceCount = 0),
            (e._idResourcesMap[this.id] = this),
            (this._released = !0),
            (this.lock = !1),
            (this._memorySize = 0),
            (this._lastUseFrameCount = -1),
            ResourceManager.currentResourceManager &&
              ResourceManager.currentResourceManager.addResource(this);
        }
        __class(e, "laya.resource.Resource", EventDispatcher);
        var i = e.prototype;
        return (
          Laya.imps(i, {
            "laya.resource.ICreateResource": !0,
            "laya.resource.IDispose": !0,
          }),
          (i._setUrl = function (t) {
            if (this._url !== t) {
              var i;
              this._url &&
                ((i = e._urlResourcesMap[this._url]).splice(i.indexOf(this), 1),
                0 === i.length && delete e._urlResourcesMap[this._url]),
                t &&
                  ((i = e._urlResourcesMap[t]) ||
                    (e._urlResourcesMap[t] = i = []),
                  i.push(this)),
                (this._url = t);
            }
          }),
          (i._getGroup = function () {
            return this._group;
          }),
          (i._setGroup = function (t) {
            if (this._group !== t) {
              var i;
              this._group &&
                ((i = e._groupResourcesMap[this._group]).splice(
                  i.indexOf(this),
                  1
                ),
                0 === i.length && delete e._groupResourcesMap[this._group]),
                t &&
                  ((i = e._groupResourcesMap[t]) ||
                    (e._groupResourcesMap[t] = i = []),
                  i.push(this)),
                (this._group = t);
            }
          }),
          (i._addReference = function () {
            this._referenceCount++;
          }),
          (i._removeReference = function () {
            this._referenceCount--;
          }),
          (i._clearReference = function () {
            this._referenceCount = 0;
          }),
          (i._endLoaded = function () {
            (this.__loaded = !0), this.event("loaded", this);
          }),
          (i.recreateResource = function () {
            this.completeCreate();
          }),
          (i.disposeResource = function () {}),
          (i.activeResource = function (t) {
            void 0 === t && (t = !1),
              (this._lastUseFrameCount = Stat.loopCount),
              !this._destroyed &&
                this.__loaded &&
                (this._released || t) &&
                this.recreateResource();
          }),
          (i.releaseResource = function (t) {
            return (
              void 0 === t && (t = !1),
              !(!t && this.lock) &&
                !(this._released && !t) &&
                (this.disposeResource(),
                (this._released = !0),
                (this._lastUseFrameCount = -1),
                this.event("released", this),
                !0)
            );
          }),
          (i.onAsynLoaded = function (t, e, i) {
            throw new Error("Resource: must override this function!");
          }),
          (i.destroy = function () {
            if (!this._destroyed) {
              null !== this._resourceManager &&
                this._resourceManager.removeResource(this),
                (this._destroyed = !0),
                (this.lock = !1),
                this.releaseResource(),
                delete e._idResourcesMap[this.id];
              var t;
              this._url &&
                ((t = e._urlResourcesMap[this._url]) &&
                  (t.splice(t.indexOf(this), 1),
                  0 === t.length && delete e._urlResourcesMap[this.url]),
                Loader.clearRes(this._url),
                this.__loaded || RunDriver.cancelLoadByUrl(this._url)),
                this._group &&
                  ((t = e._groupResourcesMap[this._group]).splice(
                    t.indexOf(this),
                    1
                  ),
                  0 === t.length && delete e._groupResourcesMap[this.url]);
            }
          }),
          (i.completeCreate = function () {
            (this._released = !1), this.event("recovered", this);
          }),
          (i.dispose = function () {
            this.destroy();
          }),
          __getset(
            0,
            i,
            "memorySize",
            function () {
              return this._memorySize;
            },
            function (t) {
              var e = t - this._memorySize;
              (this._memorySize = t),
                this.resourceManager && this.resourceManager.addSize(e);
            }
          ),
          __getset(0, i, "_loaded", null, function (t) {
            this.__loaded = t;
          }),
          __getset(0, i, "loaded", function () {
            return this.__loaded;
          }),
          __getset(0, i, "id", function () {
            return this._$1__id;
          }),
          __getset(0, i, "destroyed", function () {
            return this._destroyed;
          }),
          __getset(
            0,
            i,
            "group",
            function () {
              return this._getGroup();
            },
            function (t) {
              this._setGroup(t);
            }
          ),
          __getset(0, i, "resourceManager", function () {
            return this._resourceManager;
          }),
          __getset(0, i, "url", function () {
            return this._url;
          }),
          __getset(0, i, "released", function () {
            return this._released;
          }),
          __getset(0, i, "referenceCount", function () {
            return this._referenceCount;
          }),
          (e.getResourceByID = function (t) {
            return e._idResourcesMap[t];
          }),
          (e.getResourceByURL = function (t, i) {
            return void 0 === i && (i = 0), e._urlResourcesMap[t][i];
          }),
          (e.getResourceCountByURL = function (t) {
            return e._urlResourcesMap[t].length;
          }),
          (e.destroyUnusedResources = function (t) {
            var i;
            if (t) {
              var n = e._groupResourcesMap[t];
              if (n)
                for (var s = n.slice(), r = 0, a = s.length; r < a; r++)
                  (i = s[r]).lock || 0 !== i._referenceCount || i.destroy();
            } else
              for (var o in e._idResourcesMap)
                (i = e._idResourcesMap[o]).lock ||
                  0 !== i._referenceCount ||
                  i.destroy();
          }),
          (e._uniqueIDCounter = 0),
          (e._idResourcesMap = {}),
          (e._urlResourcesMap = {}),
          (e._groupResourcesMap = {}),
          e
        );
      })(),
      Texture = (function (t) {
        function e(t, i) {
          (this.offsetX = 0),
            (this.offsetY = 0),
            (this.sourceWidth = 0),
            (this.sourceHeight = 0),
            (this._w = 0),
            (this._h = 0),
            (this._uvID = 0),
            (this._atlasID = -1),
            (this.scaleRate = 1),
            e.__super.call(this),
            t && t._addReference(),
            this.setTo(t, i);
        }
        __class(e, "laya.resource.Texture", EventDispatcher);
        var i = e.prototype;
        return (
          (i._setUrl = function (t) {
            this.url = t;
          }),
          (i.setTo = function (t, i) {
            if (t instanceof window.HTMLElement) {
              var n = HTMLCanvas.create("2D", t);
              this.bitmap = n;
            } else this.bitmap = t;
            if (((this.uv = i || e.DEF_UV), t)) {
              (this._w = t.width),
                (this._h = t.height),
                (this.sourceWidth = this.sourceWidth || this._w),
                (this.sourceHeight = this.sourceHeight || this._h),
                (this._loaded = this._w > 0);
              var s = this;
              if (this._loaded) RunDriver.addToAtlas && RunDriver.addToAtlas(s);
              else {
                var r = t;
                r instanceof laya.resource.HTMLImage &&
                  r.image &&
                  r.image.addEventListener(
                    "load",
                    function (t) {
                      RunDriver.addToAtlas && RunDriver.addToAtlas(s);
                    },
                    !1
                  );
              }
            }
          }),
          (i.active = function () {
            this.bitmap && this.bitmap.activeResource();
          }),
          (i.destroy = function (t) {
            if (
              (void 0 === t && (t = !1),
              this.bitmap && this.bitmap.referenceCount > 0)
            ) {
              var e = this.bitmap;
              t
                ? (Render.isConchApp &&
                    e.source &&
                    e.source.conchDestroy &&
                    this.bitmap.source.conchDestroy(),
                  (this.bitmap = null),
                  e.dispose(),
                  e._clearReference())
                : (e._removeReference(),
                  0 == e.referenceCount &&
                    (Render.isConchApp &&
                      e.source &&
                      e.source.conchDestroy &&
                      this.bitmap.source.conchDestroy(),
                    (this.bitmap = null),
                    e.dispose())),
                this.url &&
                  this === Laya.loader.getRes(this.url) &&
                  Laya.loader.clearRes(this.url, t),
                (this._loaded = !1);
            }
          }),
          (i.load = function (t) {
            var e = this;
            (this._loaded = !1), (t = URL.customFormat(t));
            var i = this.bitmap || (this.bitmap = HTMLImage.create(t));
            i && i._addReference();
            var n = this;
            i.onload = function () {
              (i.onload = null),
                (n._loaded = !0),
                (e.sourceWidth = e._w = i.width),
                (e.sourceHeight = e._h = i.height),
                n.event("loaded", this),
                RunDriver.addToAtlas && RunDriver.addToAtlas(n);
            };
          }),
          (i.addTextureToAtlas = function (t) {
            RunDriver.addTextureToAtlas(this);
          }),
          (i.getPixels = function (t, e, i, n) {
            if (Render.isConchApp) {
              var s = this.bitmap;
              if (s.source && s.source.getImageData) {
                var r = s.source.getImageData(t, e, i, n),
                  a = new Uint8Array(r);
                return Array.from(a);
              }
              return null;
            }
            if (Render.isWebGL)
              return RunDriver.getTexturePixels(this, t, e, i, n);
            Browser.canvas.size(i, n),
              Browser.canvas.clear(),
              Browser.context.drawTexture(
                this,
                -t,
                -e,
                this.width,
                this.height,
                0,
                0
              );
            return Browser.context.getImageData(0, 0, i, n).data;
          }),
          (i.onAsynLoaded = function (t, e) {
            e && e._addReference(), this.setTo(e, this.uv);
          }),
          __getset(0, i, "source", function () {
            return this.bitmap
              ? (this.bitmap.activeResource(), this.bitmap.source)
              : null;
          }),
          __getset(0, i, "loaded", function () {
            return this._loaded;
          }),
          __getset(0, i, "released", function () {
            return !this.bitmap || this.bitmap.released;
          }),
          __getset(
            0,
            i,
            "width",
            function () {
              return this._w
                ? this._w
                : this.uv && this.uv !== e.DEF_UV
                ? (this.uv[2] - this.uv[0]) * this.bitmap.width
                : this.bitmap.width;
            },
            function (t) {
              (this._w = t), this.sourceWidth || (this.sourceWidth = t);
            }
          ),
          __getset(
            0,
            i,
            "repeat",
            function () {
              return !Render.isWebGL || !this.bitmap || this.bitmap.repeat;
            },
            function (t) {
              t &&
                Render.isWebGL &&
                this.bitmap &&
                ((this.bitmap.repeat = t),
                t && (this.bitmap.enableMerageInAtlas = !1));
            }
          ),
          __getset(
            0,
            i,
            "height",
            function () {
              return this._h
                ? this._h
                : this.uv && this.uv !== e.DEF_UV
                ? (this.uv[5] - this.uv[1]) * this.bitmap.height
                : this.bitmap.height;
            },
            function (t) {
              (this._h = t), this.sourceHeight || (this.sourceHeight = t);
            }
          ),
          __getset(
            0,
            i,
            "isLinearSampling",
            function () {
              return !Render.isWebGL || 9728 != this.bitmap.minFifter;
            },
            function (t) {
              !t &&
                Render.isWebGL &&
                (t ||
                  -1 != this.bitmap.minFifter ||
                  -1 != this.bitmap.magFifter ||
                  ((this.bitmap.minFifter = 9728),
                  (this.bitmap.magFifter = 9728),
                  (this.bitmap.enableMerageInAtlas = !1)));
            }
          ),
          (e.moveUV = function (t, e, i) {
            for (var n = 0; n < 8; n += 2) (i[n] += t), (i[n + 1] += e);
            return i;
          }),
          (e.create = function (t, i, n, s, r, a, o, h, l) {
            void 0 === a && (a = 0),
              void 0 === o && (o = 0),
              void 0 === h && (h = 0),
              void 0 === l && (l = 0);
            var c = t instanceof laya.resource.Texture,
              u = c ? t.uv : e.DEF_UV,
              _ = c ? t.bitmap : t,
              d = RunDriver.isAtlas(_);
            if (d) {
              var f = _._atlaser,
                p = t._atlasID;
              if (-1 == p) throw new Error("create texture error");
              (_ = f._inAtlasTextureBitmapValue[p]),
                (u = f._inAtlasTextureOriUVValue[p]);
            }
            var g = new e(_, null);
            _.width && i + s > _.width && (s = _.width - i),
              _.height && n + r > _.height && (r = _.height - n),
              (g.width = s),
              (g.height = r),
              (g.offsetX = a),
              (g.offsetY = o),
              (g.sourceWidth = h || s),
              (g.sourceHeight = l || r);
            var m = 1 / _.width,
              v = 1 / _.height;
            (i *= m), (n *= v), (s *= m), (r *= v);
            var y = g.uv[0],
              w = g.uv[1],
              x = g.uv[4],
              T = g.uv[5],
              b = x - y,
              C = T - w,
              M = e.moveUV(u[0], u[1], [
                i,
                n,
                i + s,
                n,
                i + s,
                n + r,
                i,
                n + r,
              ]);
            (g.uv = [
              y + M[0] * b,
              w + M[1] * C,
              x - (1 - M[2]) * b,
              w + M[3] * C,
              x - (1 - M[4]) * b,
              T - (1 - M[5]) * C,
              y + M[6] * b,
              T - (1 - M[7]) * C,
            ]),
              d && g.addTextureToAtlas();
            var S = _.scaleRate;
            return (
              S && 1 != S
                ? ((g.sourceWidth /= S),
                  (g.sourceHeight /= S),
                  (g.width /= S),
                  (g.height /= S),
                  (g.scaleRate = S),
                  (g.offsetX /= S),
                  (g.offsetY /= S))
                : (g.scaleRate = 1),
              g
            );
          }),
          (e.createFromTexture = function (t, i, n, s, r) {
            var a = t.scaleRate;
            1 != a && ((i *= a), (n *= a), (s *= a), (r *= a));
            var o = Rectangle.TEMP.setTo(i - t.offsetX, n - t.offsetY, s, r),
              h = o.intersection(
                e._rect1.setTo(0, 0, t.width, t.height),
                e._rect2
              );
            if (!h) return null;
            var l = e.create(
              t,
              h.x,
              h.y,
              h.width,
              h.height,
              h.x - o.x,
              h.y - o.y,
              s,
              r
            );
            return l.bitmap._removeReference(), l;
          }),
          (e.DEF_UV = [0, 0, 1, 0, 1, 1, 0, 1]),
          (e.INV_UV = [0, 1, 1, 1, 1, 0, 0, 0]),
          (e._rect1 = new Rectangle()),
          (e._rect2 = new Rectangle()),
          e
        );
      })(),
      TimeLine = (function (t) {
        function e() {
          (this._labelDic = null),
            (this._tweenDic = {}),
            (this._tweenDataList = []),
            (this._endTweenDataList = null),
            (this._currTime = 0),
            (this._lastTime = 0),
            (this._startTime = 0),
            (this._index = 0),
            (this._gidIndex = 0),
            (this._firstTweenDic = {}),
            (this._startTimeSort = !1),
            (this._endTimeSort = !1),
            (this._loopKey = !1),
            (this.scale = 1),
            (this._frameRate = 60),
            (this._frameIndex = 0),
            (this._total = 0),
            e.__super.call(this);
        }
        var i;
        __class(e, "laya.utils.TimeLine", EventDispatcher);
        var n = e.prototype;
        return (
          (n.to = function (t, e, i, n, s) {
            return void 0 === s && (s = 0), this._create(t, e, i, n, s, !0);
          }),
          (n.from = function (t, e, i, n, s) {
            return void 0 === s && (s = 0), this._create(t, e, i, n, s, !1);
          }),
          (n._create = function (t, e, n, s, r, a) {
            var o = Pool.getItemByClass("tweenData", i);
            return (
              (o.isTo = a),
              (o.type = 0),
              (o.target = t),
              (o.duration = n),
              (o.data = e),
              (o.startTime = this._startTime + r),
              (o.endTime = o.startTime + o.duration),
              (o.ease = s),
              (this._startTime = Math.max(o.endTime, this._startTime)),
              this._tweenDataList.push(o),
              (this._startTimeSort = !0),
              (this._endTimeSort = !0),
              this
            );
          }),
          (n.addLabel = function (t, e) {
            var n = Pool.getItemByClass("tweenData", i);
            return (
              (n.type = 1),
              (n.data = t),
              (n.endTime = n.startTime = this._startTime + e),
              this._labelDic || (this._labelDic = {}),
              (this._labelDic[t] = n),
              this._tweenDataList.push(n),
              this
            );
          }),
          (n.removeLabel = function (t) {
            if (this._labelDic && this._labelDic[t]) {
              var e = this._labelDic[t];
              if (e) {
                var i = this._tweenDataList.indexOf(e);
                i > -1 && this._tweenDataList.splice(i, 1);
              }
              delete this._labelDic[t];
            }
          }),
          (n.gotoTime = function (t) {
            if (
              null != this._tweenDataList &&
              0 != this._tweenDataList.length
            ) {
              var e, i;
              for (var n in this._firstTweenDic)
                if ((i = this._firstTweenDic[n]))
                  for (var s in i)
                    i.diyTarget.hasOwnProperty(s) && (i.diyTarget[s] = i[s]);
              for (n in this._tweenDic)
                (e = this._tweenDic[n]).clear(), delete this._tweenDic[n];
              (this._index = 0),
                (this._gidIndex = 0),
                (this._currTime = t),
                (this._lastTime = Browser.now());
              var r;
              null == this._endTweenDataList || this._endTimeSort
                ? ((this._endTimeSort = !1),
                  (this._endTweenDataList = r = this._tweenDataList.concat()),
                  r.sort(function (t, e) {
                    return t.endTime > e.endTime
                      ? 1
                      : t.endTime < e.endTime
                      ? -1
                      : 0;
                  }))
                : (r = this._endTweenDataList);
              for (var a, o = 0, h = r.length; o < h; o++)
                if (0 == (a = r[o]).type) {
                  if (!(t >= a.endTime)) break;
                  this._index = Math.max(this._index, o + 1);
                  var l = a.data;
                  if (a.isTo) for (var c in l) a.target[c] = l[c];
                }
              for (o = 0, h = this._tweenDataList.length; o < h; o++)
                0 == (a = this._tweenDataList[o]).type &&
                  t >= a.startTime &&
                  t < a.endTime &&
                  ((this._index = Math.max(this._index, o + 1)),
                  this._gidIndex++,
                  (e = Pool.getItemByClass("tween", Tween))._create(
                    a.target,
                    a.data,
                    a.duration,
                    a.ease,
                    Handler.create(this, this._animComplete, [this._gidIndex]),
                    0,
                    !1,
                    a.isTo,
                    !0,
                    !1
                  ),
                  e.setStartTime(this._currTime - (t - a.startTime)),
                  e._updateEase(this._currTime),
                  (e.gid = this._gidIndex),
                  (this._tweenDic[this._gidIndex] = e));
            }
          }),
          (n.gotoLabel = function (t) {
            if (null != this._labelDic) {
              var e = this._labelDic[t];
              e && this.gotoTime(e.startTime);
            }
          }),
          (n.pause = function () {
            Laya.timer.clear(this, this._update);
          }),
          (n.resume = function () {
            this.play(this._currTime, this._loopKey);
          }),
          (n.play = function (t, e) {
            if (
              (void 0 === t && (t = 0),
              void 0 === e && (e = !1),
              this._tweenDataList)
            ) {
              if (this._startTimeSort) {
                (this._startTimeSort = !1),
                  this._tweenDataList.sort(function (t, e) {
                    return t.startTime > e.startTime
                      ? 1
                      : t.startTime < e.startTime
                      ? -1
                      : 0;
                  });
                for (var i = 0, n = this._tweenDataList.length; i < n; i++) {
                  var s = this._tweenDataList[i];
                  if (null != s && 0 == s.type) {
                    var r = s.target,
                      a = r.$_GID || (r.$_GID = Utils.getGID()),
                      o = null;
                    null == this._firstTweenDic[a]
                      ? (((o = {}).diyTarget = r), (this._firstTweenDic[a] = o))
                      : (o = this._firstTweenDic[a]);
                    for (var h in s.data) null == o[h] && (o[h] = r[h]);
                  }
                }
              }
              "string" == typeof t ? this.gotoLabel(t) : this.gotoTime(t),
                (this._loopKey = e),
                (this._lastTime = Browser.now()),
                Laya.timer.frameLoop(1, this, this._update);
            }
          }),
          (n._update = function () {
            if (this._currTime >= this._startTime) {
              if (!this._loopKey) {
                for (var t in this._tweenDic)
                  (s = this._tweenDic[t]).complete();
                return this._complete(), void this.pause();
              }
              if ((this._complete(), !this._tweenDataList)) return;
              this.gotoTime(0);
            }
            var e = Browser.now(),
              i = e - this._lastTime,
              n = (this._currTime += i * this.scale);
            this._lastTime = e;
            for (t in this._tweenDic) (s = this._tweenDic[t])._updateEase(n);
            var s;
            if (
              0 != this._tweenDataList.length &&
              this._index < this._tweenDataList.length
            ) {
              var r = this._tweenDataList[this._index];
              n >= r.startTime &&
                (this._index++,
                0 == r.type
                  ? (this._gidIndex++,
                    (s = Pool.getItemByClass("tween", Tween))._create(
                      r.target,
                      r.data,
                      r.duration,
                      r.ease,
                      Handler.create(this, this._animComplete, [
                        this._gidIndex,
                      ]),
                      0,
                      !1,
                      r.isTo,
                      !0,
                      !1
                    ),
                    s.setStartTime(n),
                    (s.gid = this._gidIndex),
                    (this._tweenDic[this._gidIndex] = s),
                    s._updateEase(n))
                  : this.event("label", r.data));
            }
          }),
          (n._animComplete = function (t) {
            this._tweenDic[t] && delete this._tweenDic[t];
          }),
          (n._complete = function () {
            this.event("complete");
          }),
          (n.reset = function () {
            var t;
            if (this._labelDic)
              for (t in this._labelDic) delete this._labelDic[t];
            for (t in this._tweenDic)
              this._tweenDic[t].clear(), delete this._tweenDic[t];
            for (t in this._firstTweenDic) delete this._firstTweenDic[t];
            if (
              ((this._endTweenDataList = null),
              this._tweenDataList && this._tweenDataList.length)
            ) {
              var e = 0,
                i = 0;
              for (i = this._tweenDataList.length, e = 0; e < i; e++)
                this._tweenDataList[e] && this._tweenDataList[e].destroy();
            }
            (this._tweenDataList.length = 0),
              (this._currTime = 0),
              (this._lastTime = 0),
              (this._startTime = 0),
              (this._index = 0),
              (this._gidIndex = 0),
              (this.scale = 1),
              Laya.timer.clear(this, this._update);
          }),
          (n.destroy = function () {
            this.reset(),
              (this._labelDic = null),
              (this._tweenDic = null),
              (this._tweenDataList = null),
              (this._firstTweenDic = null);
          }),
          __getset(
            0,
            n,
            "index",
            function () {
              return this._frameIndex;
            },
            function (t) {
              (this._frameIndex = t),
                this.gotoTime((this._frameIndex / this._frameRate) * 1e3);
            }
          ),
          __getset(0, n, "total", function () {
            return (
              (this._total = Math.floor(
                (this._startTime / 1e3) * this._frameRate
              )),
              this._total
            );
          }),
          (e.to = function (t, i, n, s, r) {
            return void 0 === r && (r = 0), new e().to(t, i, n, s, r);
          }),
          (e.from = function (t, i, n, s, r) {
            return void 0 === r && (r = 0), new e().from(t, i, n, s, r);
          }),
          (e.__init$ = function () {
            i = (function () {
              function t() {
                (this.type = 0),
                  (this.isTo = !0),
                  (this.startTime = NaN),
                  (this.endTime = NaN),
                  (this.target = null),
                  (this.duration = NaN),
                  (this.ease = null),
                  (this.data = null);
              }
              __class(t, "");
              return (
                (t.prototype.destroy = function () {
                  (this.target = null),
                    (this.ease = null),
                    (this.data = null),
                    (this.isTo = !0),
                    (this.type = 0),
                    Pool.recover("tweenData", this);
                }),
                t
              );
            })();
          }),
          e
        );
      })(),
      Sprite = (function (t) {
        function e() {
          (this._transform = null),
            (this._tfChanged = !1),
            (this._x = 0),
            (this._y = 0),
            (this._width = 0),
            (this._height = 0),
            (this._repaint = 1),
            (this._mouseEnableState = 0),
            (this._zOrder = 0),
            (this._graphics = null),
            (this._renderType = 0),
            (this._optimizeScrollRect = !1),
            (this._texture = null),
            (this.mouseThrough = !1),
            (this.autoSize = !1),
            (this.hitTestPrior = !1),
            (this.viewport = null),
            e.__super.call(this),
            (this._style = Style.EMPTY);
        }
        __class(e, "laya.display.Sprite", t);
        var i = e.prototype;
        return (
          Laya.imps(i, { "laya.display.ILayout": !0 }),
          (i.createConchModel = function () {
            return new ConchNode();
          }),
          (i.destroy = function (e) {
            void 0 === e && (e = !0),
              this._releaseMem(),
              t.prototype.destroy.call(this, e),
              this._style && this._style.destroy(),
              this._transform && this._transform.destroy(),
              (this._transform = null),
              (this._style = null),
              (this._graphics = null);
          }),
          (i.updateZOrder = function () {
            Utils.updateOrder(this._childs) && this.repaint();
          }),
          (i.reCache = function () {
            this._$P.cacheCanvas && (this._$P.cacheCanvas.reCache = !0),
              (this._repaint = 1);
          }),
          (i.setBounds = function (t) {
            this._set$P("uBounds", t);
          }),
          (i.getBounds = function () {
            return (
              this._$P.mBounds || this._set$P("mBounds", new Rectangle()),
              Rectangle._getWrapRec(
                this._boundPointsToParent(),
                this._$P.mBounds
              )
            );
          }),
          (i.getSelfBounds = function () {
            return this._$P.uBounds
              ? this._$P.uBounds
              : (this._$P.mBounds || this._set$P("mBounds", new Rectangle()),
                Rectangle._getWrapRec(
                  this._getBoundPointsM(!1),
                  this._$P.mBounds
                ));
          }),
          (i._boundPointsToParent = function (t) {
            void 0 === t && (t = !1);
            var e = 0,
              i = 0;
            this._style &&
              ((e = this._style._tf.translateX),
              (i = this._style._tf.translateY),
              (t = t || 0 !== this._style._tf.rotate),
              this._style.scrollRect &&
                ((e += this._style.scrollRect.x),
                (i += this._style.scrollRect.y)));
            var n = this._getBoundPointsM(t);
            if (!n || n.length < 1) return n;
            if (
              (8 != n.length &&
                (n = t
                  ? GrahamScan.scanPList(n)
                  : Rectangle._getWrapRec(n, Rectangle.TEMP)._getBoundPoints()),
              !this.transform)
            )
              return Utils.transPointList(n, this._x - e, this._y - i), n;
            var s = Point.TEMP,
              r = 0,
              a = n.length;
            for (r = 0; r < a; r += 2)
              (s.x = n[r]),
                (s.y = n[r + 1]),
                this.toParentPoint(s),
                (n[r] = s.x),
                (n[r + 1] = s.y);
            return n;
          }),
          (i.getGraphicBounds = function (t) {
            return (
              void 0 === t && (t = !1),
              this._graphics
                ? this._graphics.getBounds(t)
                : Rectangle.TEMP.setTo(0, 0, 0, 0)
            );
          }),
          (i._getBoundPointsM = function (t) {
            if ((void 0 === t && (t = !1), this._$P.uBounds))
              return this._$P.uBounds._getBoundPoints();
            if ((this._$P.temBM || this._set$P("temBM", []), this.scrollRect)) {
              var e = Utils.clearArray(this._$P.temBM),
                i = Rectangle.TEMP;
              return (
                i.copyFrom(this.scrollRect),
                Utils.concatArray(e, i._getBoundPoints()),
                e
              );
            }
            for (
              var n,
                s,
                r,
                a = this._graphics
                  ? this._graphics.getBoundPoints()
                  : Utils.clearArray(this._$P.temBM),
                o = 0,
                h = (r = this._childs).length;
              o < h;
              o++
            )
              (n = r[o]) instanceof laya.display.Sprite &&
                1 == n.visible &&
                (s = n._boundPointsToParent(t)) &&
                (a = a ? Utils.concatArray(a, s) : s);
            return a;
          }),
          (i.getStyle = function () {
            return (
              this._style === Style.EMPTY && (this._style = new Style()),
              this._style
            );
          }),
          (i.setStyle = function (t) {
            this._style = t;
          }),
          (i._adjustTransform = function () {
            "use strict";
            this._tfChanged = !1;
            var t,
              e = this._style._tf,
              i = e.scaleX,
              n = e.scaleY;
            if (e.rotate || 1 !== i || 1 !== n || e.skewX || e.skewY) {
              (t =
                this._transform ||
                (this._transform = Matrix.create())).bTransform = !0;
              var s = 0.0174532922222222 * (e.rotate - e.skewX),
                r = 0.0174532922222222 * (e.rotate + e.skewY),
                a = Math.cos(r),
                o = Math.sin(r),
                h = Math.sin(s),
                l = Math.cos(s);
              return (
                (t.a = i * a),
                (t.b = i * o),
                (t.c = -n * h),
                (t.d = n * l),
                (t.tx = t.ty = 0),
                t
              );
            }
            return (
              this._transform && this._transform.destroy(),
              (this._transform = null),
              (this._renderType &= -5),
              t
            );
          }),
          (i.pos = function (t, e, i) {
            if ((void 0 === i && (i = !1), this._x !== t || this._y !== e)) {
              if (this.destroyed) return this;
              if (i) {
                (this._x = t),
                  (this._y = e),
                  this.conchModel && this.conchModel.pos(this._x, this._y);
                var n = this._parent;
                n && 0 === n._repaint && ((n._repaint = 1), n.parentRepaint()),
                  this._$P.maskParent &&
                    0 === this._$P.maskParent._repaint &&
                    ((this._$P.maskParent._repaint = 1),
                    this._$P.maskParent.parentRepaint());
              } else (this.x = t), (this.y = e);
            }
            return this;
          }),
          (i.pivot = function (t, e) {
            return (this.pivotX = t), (this.pivotY = e), this;
          }),
          (i.size = function (t, e) {
            return (this.width = t), (this.height = e), this;
          }),
          (i.scale = function (t, e, i) {
            void 0 === i && (i = !1);
            var n = this.getStyle(),
              s = n._tf;
            if (s.scaleX != t || s.scaleY != e) {
              if (this.destroyed) return this;
              if (i) {
                n.setScale(t, e),
                  (this._tfChanged = !0),
                  this.conchModel && this.conchModel.scale(t, e),
                  (this._renderType |= 4);
                var r = this._parent;
                r && 0 === r._repaint && ((r._repaint = 1), r.parentRepaint());
              } else (this.scaleX = t), (this.scaleY = e);
            }
            return this;
          }),
          (i.skew = function (t, e) {
            return (this.skewX = t), (this.skewY = e), this;
          }),
          (i.render = function (t, e, i) {
            Stat.spriteCount++,
              RenderSprite.renders[this._renderType]._fun(
                this,
                t,
                e + this._x,
                i + this._y
              ),
              (this._repaint = 0);
          }),
          (i.drawToCanvas = function (t, e, i, n) {
            if (Render.isConchNode) {
              var s = HTMLCanvas.create("2D");
              return (
                new RenderContext(t, e, s).ctx.setCanvasType(1),
                this.conchModel.drawToCanvas(s.source, i, n),
                s
              );
            }
            return RunDriver.drawToCanvas(this, this._renderType, t, e, i, n);
          }),
          (i.customRender = function (t, e, i) {
            this._renderType |= 1024;
          }),
          (i._applyFilters = function () {
            if (!Render.isWebGL) {
              var t;
              if ((t = this._$P.filters) && !(t.length < 1))
                for (var e = 0, i = t.length; e < i; e++)
                  t[e].action.apply(this._$P.cacheCanvas);
            }
          }),
          (i._isHaveGlowFilter = function () {
            var t = 0,
              e = 0;
            if (this.filters)
              for (t = 0; t < this.filters.length; t++)
                if (8 == this.filters[t].type) return !0;
            for (t = 0, e = this._childs.length; t < e; t++)
              if (this._childs[t]._isHaveGlowFilter()) return !0;
            return !1;
          }),
          (i.localToGlobal = function (t, e) {
            void 0 === e && (e = !1), !0 === e && (t = new Point(t.x, t.y));
            for (var i = this; i && i != Laya.stage; )
              (t = i.toParentPoint(t)), (i = i.parent);
            return t;
          }),
          (i.globalToLocal = function (t, e) {
            void 0 === e && (e = !1), e && (t = new Point(t.x, t.y));
            for (var i = this, n = []; i && i != Laya.stage; )
              n.push(i), (i = i.parent);
            for (var s = n.length - 1; s >= 0; )
              (t = (i = n[s]).fromParentPoint(t)), s--;
            return t;
          }),
          (i.toParentPoint = function (t) {
            if (!t) return t;
            (t.x -= this.pivotX),
              (t.y -= this.pivotY),
              this.transform && this._transform.transformPoint(t),
              (t.x += this._x),
              (t.y += this._y);
            var e = this._style.scrollRect;
            return e && ((t.x -= e.x), (t.y -= e.y)), t;
          }),
          (i.fromParentPoint = function (t) {
            if (!t) return t;
            (t.x -= this._x), (t.y -= this._y);
            var e = this._style.scrollRect;
            return (
              e && ((t.x += e.x), (t.y += e.y)),
              this.transform && this._transform.invertTransformPoint(t),
              (t.x += this.pivotX),
              (t.y += this.pivotY),
              t
            );
          }),
          (i.on = function (e, i, n, s) {
            return 1 !== this._mouseEnableState && this.isMouseEvent(e)
              ? ((this.mouseEnabled = !0),
                this._setBit(2, !0),
                this._parent && this._$2__onDisplay(),
                this._createListener(e, i, n, s, !1))
              : t.prototype.on.call(this, e, i, n, s);
          }),
          (i.once = function (e, i, n, s) {
            return 1 !== this._mouseEnableState && this.isMouseEvent(e)
              ? ((this.mouseEnabled = !0),
                this._setBit(2, !0),
                this._parent && this._$2__onDisplay(),
                this._createListener(e, i, n, s, !0))
              : t.prototype.once.call(this, e, i, n, s);
          }),
          (i._$2__onDisplay = function () {
            if (1 !== this._mouseEnableState) {
              var t = this;
              for (
                t = t.parent;
                t && 1 !== t._mouseEnableState && !t._getBit(2);

              )
                (t.mouseEnabled = !0), t._setBit(2, !0), (t = t.parent);
            }
          }),
          (i.loadImage = function (t, e, i, n, s, r) {
            var a = this;
            return (
              void 0 === e && (e = 0),
              void 0 === i && (i = 0),
              void 0 === n && (n = 0),
              void 0 === s && (s = 0),
              this.graphics.loadImage(t, e, i, n, s, function (t) {
                a.destroyed ||
                  (a.size(e + (n || t.width), i + (s || t.height)),
                  a.repaint(),
                  r && r.runWith(t));
              }),
              this
            );
          }),
          (i.repaint = function () {
            this.conchModel &&
              this.conchModel.repaint &&
              this.conchModel.repaint(),
              0 === this._repaint &&
                ((this._repaint = 1), this.parentRepaint()),
              this._$P && this._$P.maskParent && this._$P.maskParent.repaint();
          }),
          (i._needRepaint = function () {
            return (
              0 !== this._repaint &&
              this._$P.cacheCanvas &&
              this._$P.cacheCanvas.reCache
            );
          }),
          (i._childChanged = function (t) {
            this._childs.length
              ? (this._renderType |= 2048)
              : (this._renderType &= -2049),
              t &&
                this._get$P("hasZorder") &&
                Laya.timer.callLater(this, this.updateZOrder),
              this.repaint();
          }),
          (i.parentRepaint = function () {
            var t = this._parent;
            t && 0 === t._repaint && ((t._repaint = 1), t.parentRepaint());
          }),
          (i.startDrag = function (t, e, i, n, s, r, a) {
            void 0 === e && (e = !1),
              void 0 === i && (i = 0),
              void 0 === n && (n = 300),
              void 0 === r && (r = !1),
              void 0 === a && (a = 0.92),
              this._$P.dragging || this._set$P("dragging", new Dragging()),
              this._$P.dragging.start(this, t, e, i, n, s, r, a);
          }),
          (i.stopDrag = function () {
            this._$P.dragging && this._$P.dragging.stop();
          }),
          (i._releaseMem = function () {
            if (this._$P) {
              var t = this._$P.cacheCanvas;
              t &&
                t.ctx &&
                (Pool.recover("RenderContext", t.ctx),
                t.ctx.canvas.size(0, 0),
                (t.ctx = null));
              var e = this._$P._filterCache;
              e &&
                (e.destroy(), e.recycle(), this._set$P("_filterCache", null)),
                this._$P._isHaveGlowFilter &&
                  this._set$P("_isHaveGlowFilter", !1),
                (this._$P._isHaveGlowFilter = null);
            }
          }),
          (i._setDisplay = function (e) {
            e || this._releaseMem(), t.prototype._setDisplay.call(this, e);
          }),
          (i.hitTestPoint = function (t, e) {
            var i = this.globalToLocal(Point.TEMP.setTo(t, e));
            (t = i.x), (e = i.y);
            return (
              this._$P.hitArea
                ? this._$P.hitArea
                : this._width > 0 && this._height > 0
                ? Rectangle.TEMP.setTo(0, 0, this._width, this._height)
                : this.getSelfBounds()
            ).contains(t, e);
          }),
          (i.getMousePoint = function () {
            return this.globalToLocal(
              Point.TEMP.setTo(Laya.stage.mouseX, Laya.stage.mouseY)
            );
          }),
          (i._getWords = function () {
            return null;
          }),
          (i._addChildsToLayout = function (t) {
            var e = this._getWords();
            if (null == e && 0 == this._childs.length) return !1;
            if (e) for (var i = 0, n = e.length; i < n; i++) t.push(e[i]);
            return (
              this._childs.forEach(function (e, i, n) {
                e._style._enableLayout() && e._addToLayout(t);
              }),
              !0
            );
          }),
          (i._addToLayout = function (t) {
            this._style.absolute ||
              (this._style.block
                ? t.push(this)
                : this._addChildsToLayout(t) && (this.x = this.y = 0));
          }),
          (i._isChar = function () {
            return !1;
          }),
          (i._getCSSStyle = function () {
            return this._style.getCSSStyle();
          }),
          (i._setAttributes = function (t, e) {
            switch (t) {
              case "x":
                this.x = parseFloat(e);
                break;
              case "y":
                this.y = parseFloat(e);
                break;
              case "width":
                this.width = parseFloat(e);
                break;
              case "height":
                this.height = parseFloat(e);
                break;
              default:
                this[t] = e;
            }
          }),
          (i._layoutLater = function () {
            this.parent && this.parent._layoutLater();
          }),
          __getset(
            0,
            i,
            "optimizeScrollRect",
            function () {
              return this._optimizeScrollRect;
            },
            function (t) {
              this._optimizeScrollRect != t &&
                ((this._optimizeScrollRect = t),
                this.conchModel && this.conchModel.optimizeScrollRect(t));
            }
          ),
          __getset(0, i, "customRenderEnable", null, function (t) {
            if (t && ((this._renderType |= 1024), Render.isConchNode)) {
              e.CustomList.push(this);
              var i = new HTMLCanvas("2d");
              i._setContext(new CanvasRenderingContext2D()),
                (this.customContext = new RenderContext(0, 0, i)),
                i.context.setCanvasType && i.context.setCanvasType(2),
                this.conchModel.custom(i.context);
            }
          }),
          __getset(
            0,
            i,
            "cacheAsBitmap",
            function () {
              return "none" !== this.cacheAs;
            },
            function (t) {
              this.cacheAs = t
                ? this._$P.hasFilter
                  ? "none"
                  : "normal"
                : "none";
            }
          ),
          __getset(
            0,
            i,
            "cacheAs",
            function () {
              return null == this._$P.cacheCanvas
                ? "none"
                : this._$P.cacheCanvas.type;
            },
            function (t) {
              var e = this._$P.cacheCanvas;
              if (t !== (e ? e.type : "none")) {
                if ("none" !== t)
                  this._getBit(1) || this._setUpNoticeType(1),
                    e ||
                      (e = this._set$P(
                        "cacheCanvas",
                        Pool.getItemByClass("cacheCanvas", Object)
                      )),
                    (e.type = t),
                    (e.reCache = !0),
                    (this._renderType |= 16),
                    "bitmap" == t &&
                      this.conchModel &&
                      this.conchModel.cacheAs(1),
                    this._set$P("cacheForFilters", !1);
                else if (this._$P.hasFilter) this._set$P("cacheForFilters", !0);
                else {
                  if (e) {
                    var i = e;
                    i &&
                      i.ctx &&
                      (Pool.recover("RenderContext", i.ctx),
                      i.ctx.canvas.size(0, 0),
                      (i.ctx = null)),
                      Pool.recover("cacheCanvas", e);
                  }
                  (this._$P.cacheCanvas = null),
                    (this._renderType &= -17),
                    this.conchModel && this.conchModel.cacheAs(0);
                }
                this.repaint();
              }
            }
          ),
          __getset(
            0,
            i,
            "zOrder",
            function () {
              return this._zOrder;
            },
            function (t) {
              this._zOrder != t &&
                ((this._zOrder = t),
                this.conchModel &&
                  this.conchModel.setZOrder &&
                  this.conchModel.setZOrder(t),
                this._parent &&
                  (t && this._parent._set$P("hasZorder", !0),
                  Laya.timer.callLater(this._parent, this.updateZOrder)));
            }
          ),
          __getset(
            0,
            i,
            "rotation",
            function () {
              return this._style._tf.rotate;
            },
            function (t) {
              var e = this.getStyle();
              if (e._tf.rotate !== t) {
                e.setRotate(t),
                  (this._tfChanged = !0),
                  this.conchModel && this.conchModel.rotate(t),
                  (this._renderType |= 4);
                var i = this._parent;
                i && 0 === i._repaint && ((i._repaint = 1), i.parentRepaint());
              }
            }
          ),
          __getset(
            0,
            i,
            "width",
            function () {
              return this.autoSize ? this.getSelfBounds().width : this._width;
            },
            function (t) {
              this._width !== t &&
                ((this._width = t),
                this.conchModel && this.conchModel.size(t, this._height),
                this.repaint());
            }
          ),
          __getset(
            0,
            i,
            "x",
            function () {
              return this._x;
            },
            function (t) {
              if (this._x !== t) {
                if (this.destroyed) return;
                (this._x = t),
                  this.conchModel && this.conchModel.pos(t, this._y);
                var e = this._parent;
                e && 0 === e._repaint && ((e._repaint = 1), e.parentRepaint()),
                  this._$P.maskParent &&
                    0 === this._$P.maskParent._repaint &&
                    ((this._$P.maskParent._repaint = 1),
                    this._$P.maskParent.parentRepaint());
              }
            }
          ),
          __getset(0, i, "globalScaleY", function () {
            for (var t = 1, e = this; e && e !== Laya.stage; )
              (t *= e.scaleY), (e = e.parent);
            return t;
          }),
          __getset(
            0,
            i,
            "hitArea",
            function () {
              return this._$P.hitArea;
            },
            function (t) {
              this._set$P("hitArea", t);
            }
          ),
          __getset(
            0,
            i,
            "staticCache",
            function () {
              return this._$P.staticCache;
            },
            function (t) {
              this._set$P("staticCache", t), t || this.reCache();
            }
          ),
          __getset(
            0,
            i,
            "texture",
            function () {
              return this._texture;
            },
            function (t) {
              this._texture != t &&
                ((this._texture = t), this.graphics.cleanByTexture(t, 0, 0));
            }
          ),
          __getset(
            0,
            i,
            "y",
            function () {
              return this._y;
            },
            function (t) {
              if (this._y !== t) {
                if (this.destroyed) return;
                (this._y = t),
                  this.conchModel && this.conchModel.pos(this._x, t);
                var e = this._parent;
                e && 0 === e._repaint && ((e._repaint = 1), e.parentRepaint()),
                  this._$P.maskParent &&
                    0 === this._$P.maskParent._repaint &&
                    ((this._$P.maskParent._repaint = 1),
                    this._$P.maskParent.parentRepaint());
              }
            }
          ),
          __getset(
            0,
            i,
            "height",
            function () {
              return this.autoSize ? this.getSelfBounds().height : this._height;
            },
            function (t) {
              this._height !== t &&
                ((this._height = t),
                this.conchModel && this.conchModel.size(this._width, t),
                this.repaint());
            }
          ),
          __getset(
            0,
            i,
            "blendMode",
            function () {
              return this._style.blendMode;
            },
            function (t) {
              (this.getStyle().blendMode = t),
                this.conchModel && this.conchModel.blendMode(t),
                t && "source-over" != t
                  ? (this._renderType |= 8)
                  : (this._renderType &= -9),
                this.parentRepaint();
            }
          ),
          __getset(
            0,
            i,
            "scaleX",
            function () {
              return this._style._tf.scaleX;
            },
            function (t) {
              var e = this.getStyle();
              if (e._tf.scaleX !== t) {
                e.setScaleX(t),
                  (this._tfChanged = !0),
                  this.conchModel && this.conchModel.scale(t, e._tf.scaleY),
                  (this._renderType |= 4);
                var i = this._parent;
                i && 0 === i._repaint && ((i._repaint = 1), i.parentRepaint());
              }
            }
          ),
          __getset(
            0,
            i,
            "scaleY",
            function () {
              return this._style._tf.scaleY;
            },
            function (t) {
              var e = this.getStyle();
              if (e._tf.scaleY !== t) {
                e.setScaleY(t),
                  (this._tfChanged = !0),
                  this.conchModel && this.conchModel.scale(e._tf.scaleX, t),
                  (this._renderType |= 4);
                var i = this._parent;
                i && 0 === i._repaint && ((i._repaint = 1), i.parentRepaint());
              }
            }
          ),
          __getset(0, i, "stage", function () {
            return Laya.stage;
          }),
          __getset(
            0,
            i,
            "skewX",
            function () {
              return this._style._tf.skewX;
            },
            function (t) {
              var e = this.getStyle();
              if (e._tf.skewX !== t) {
                e.setSkewX(t),
                  (this._tfChanged = !0),
                  this.conchModel && this.conchModel.skew(t, e._tf.skewY),
                  (this._renderType |= 4);
                var i = this._parent;
                i && 0 === i._repaint && ((i._repaint = 1), i.parentRepaint());
              }
            }
          ),
          __getset(
            0,
            i,
            "scrollRect",
            function () {
              return this._style.scrollRect;
            },
            function (t) {
              (this.getStyle().scrollRect = t),
                this.repaint(),
                t
                  ? ((this._renderType |= 128),
                    this.conchModel &&
                      this.conchModel.scrollRect(t.x, t.y, t.width, t.height))
                  : ((this._renderType &= -129),
                    this.conchModel &&
                      (e.RUNTIMEVERION < "0.9.1"
                        ? this.conchModel.removeType(64)
                        : this.conchModel.removeType(128)));
            }
          ),
          __getset(
            0,
            i,
            "skewY",
            function () {
              return this._style._tf.skewY;
            },
            function (t) {
              var e = this.getStyle();
              if (e._tf.skewY !== t) {
                e.setSkewY(t),
                  (this._tfChanged = !0),
                  this.conchModel && this.conchModel.skew(e._tf.skewX, t),
                  (this._renderType |= 4);
                var i = this._parent;
                i && 0 === i._repaint && ((i._repaint = 1), i.parentRepaint());
              }
            }
          ),
          __getset(
            0,
            i,
            "transform",
            function () {
              return this._tfChanged
                ? this._adjustTransform()
                : this._transform;
            },
            function (t) {
              (this._tfChanged = !1),
                (this._transform = t),
                t &&
                  ((this._x = t.tx),
                  (this._y = t.ty),
                  (t.tx = t.ty = 0),
                  this.conchModel &&
                    this.conchModel.transform(
                      t.a,
                      t.b,
                      t.c,
                      t.d,
                      this._x,
                      this._y
                    )),
                t
                  ? (this._renderType |= 4)
                  : ((this._renderType &= -5),
                    this.conchModel && this.conchModel.removeType(4)),
                this.parentRepaint();
            }
          ),
          __getset(
            0,
            i,
            "pivotX",
            function () {
              return this._style._tf.translateX;
            },
            function (t) {
              this.getStyle().setTranslateX(t),
                this.conchModel &&
                  this.conchModel.pivot(t, this._style._tf.translateY),
                this.repaint();
            }
          ),
          __getset(
            0,
            i,
            "pivotY",
            function () {
              return this._style._tf.translateY;
            },
            function (t) {
              this.getStyle().setTranslateY(t),
                this.conchModel &&
                  this.conchModel.pivot(this._style._tf.translateX, t),
                this.repaint();
            }
          ),
          __getset(
            0,
            i,
            "alpha",
            function () {
              return this._style.alpha;
            },
            function (t) {
              this._style &&
                this._style.alpha !== t &&
                ((t = t < 0 ? 0 : t > 1 ? 1 : t),
                (this.getStyle().alpha = t),
                this.conchModel && this.conchModel.alpha(t),
                1 !== t ? (this._renderType |= 2) : (this._renderType &= -3),
                this.parentRepaint());
            }
          ),
          __getset(
            0,
            i,
            "visible",
            function () {
              return this._style.visible;
            },
            function (t) {
              this._style &&
                this._style.visible !== t &&
                ((this.getStyle().visible = t),
                this.conchModel && this.conchModel.visible(t),
                this.parentRepaint());
            }
          ),
          __getset(
            0,
            i,
            "graphics",
            function () {
              return (
                this._graphics || (this.graphics = RunDriver.createGraphics())
              );
            },
            function (t) {
              this._graphics && (this._graphics._sp = null),
                (this._graphics = t),
                t
                  ? ((this._renderType &= -2),
                    (this._renderType |= 512),
                    (t._sp = this),
                    this.conchModel && this.conchModel.graphics(this._graphics))
                  : ((this._renderType &= -513),
                    (this._renderType &= -2),
                    this.conchModel &&
                      (e.RUNTIMEVERION < "0.9.1"
                        ? this.conchModel.removeType(256)
                        : this.conchModel.removeType(512))),
                this.repaint();
            }
          ),
          __getset(
            0,
            i,
            "filters",
            function () {
              return this._$P.filters;
            },
            function (t) {
              t && 0 === t.length && (t = null),
                this._$P.filters != t &&
                  (this._set$P("filters", t ? t.slice() : null),
                  Render.isConchApp &&
                    (this.conchModel &&
                      (e.RUNTIMEVERION < "0.9.1"
                        ? this.conchModel.removeType(16)
                        : this.conchModel.removeType(32)),
                    this._$P.filters &&
                      1 == this._$P.filters.length &&
                      this._$P.filters[0].callNative(this)),
                  Render.isWebGL &&
                    (t && t.length
                      ? (this._renderType |= 32)
                      : (this._renderType &= -33)),
                  t && t.length > 0
                    ? (this._getBit(1) || this._setUpNoticeType(1),
                      (Render.isWebGL &&
                        1 == t.length &&
                        t[0] instanceof laya.filters.ColorFilter) ||
                        ("bitmap" != this.cacheAs &&
                          (Render.isConchNode || (this.cacheAs = "bitmap"),
                          this._set$P("cacheForFilters", !0)),
                        this._set$P("hasFilter", !0)))
                    : (this._set$P("hasFilter", !1),
                      this._$P.cacheForFilters &&
                        "bitmap" == this.cacheAs &&
                        (this.cacheAs = "none")),
                  this.repaint());
            }
          ),
          __getset(0, i, "parent", t.prototype._$get_parent, function (t) {
            Laya.superSet(Node, this, "parent", t),
              t && this._getBit(2) && this._$2__onDisplay();
          }),
          __getset(
            0,
            i,
            "mask",
            function () {
              return this._$P._mask;
            },
            function (t) {
              (t && this.mask && this.mask._$P.maskParent) ||
                (t
                  ? ((this.cacheAs = "bitmap"),
                    this._set$P("_mask", t),
                    t._set$P("maskParent", this))
                  : ((this.cacheAs = "none"),
                    this.mask && this.mask._set$P("maskParent", null),
                    this._set$P("_mask", t)),
                this.conchModel &&
                  this.conchModel.mask(t ? t.conchModel : null),
                (this._renderType |= 64),
                this.parentRepaint());
            }
          ),
          __getset(
            0,
            i,
            "mouseEnabled",
            function () {
              return this._mouseEnableState > 1;
            },
            function (t) {
              this._mouseEnableState = t ? 2 : 1;
            }
          ),
          __getset(0, i, "globalScaleX", function () {
            for (var t = 1, e = this; e && e !== Laya.stage; )
              (t *= e.scaleX), (e = e.parent);
            return t;
          }),
          __getset(0, i, "mouseX", function () {
            return this.getMousePoint().x;
          }),
          __getset(0, i, "mouseY", function () {
            return this.getMousePoint().y;
          }),
          (e.fromImage = function (t) {
            return new e().loadImage(t);
          }),
          (e.CustomList = []),
          __static(e, [
            "RUNTIMEVERION",
            function () {
              return (this.RUNTIMEVERION = window.conch
                ? conchConfig
                    .getRuntimeVersion()
                    .substr(
                      conchConfig.getRuntimeVersion().lastIndexOf("-") + 1
                    )
                : "");
            },
          ]),
          e
        );
      })(Node),
      AudioSoundChannel = (function (t) {
        function e(t) {
          (this._audio = null),
            (this._onEnd = null),
            (this._resumePlay = null),
            e.__super.call(this),
            (this._onEnd = Utils.bind(this.__onEnd, this)),
            (this._resumePlay = Utils.bind(this.__resumePlay, this)),
            t.addEventListener("ended", this._onEnd),
            (this._audio = t);
        }
        __class(e, "laya.media.h5audio.AudioSoundChannel", SoundChannel);
        var i = e.prototype;
        return (
          (i.__onEnd = function () {
            if (1 == this.loops)
              return (
                this.completeHandler &&
                  (Laya.timer.once(
                    10,
                    this,
                    this.__runComplete,
                    [this.completeHandler],
                    !1
                  ),
                  (this.completeHandler = null)),
                this.stop(),
                void this.event("complete")
              );
            this.loops > 0 && this.loops--, (this.startTime = 0), this.play();
          }),
          (i.__resumePlay = function () {
            this._audio &&
              this._audio.removeEventListener("canplay", this._resumePlay);
            try {
              (this._audio.currentTime = this.startTime),
                Browser.container.appendChild(this._audio),
                this._audio.play();
            } catch (t) {
              this.event("error");
            }
          }),
          (i.play = function () {
            this.isStopped = !1;
            try {
              (this._audio.playbackRate = SoundManager.playbackRate),
                (this._audio.currentTime = this.startTime);
            } catch (t) {
              return void this._audio.addEventListener(
                "canplay",
                this._resumePlay
              );
            }
            SoundManager.addChannel(this),
              Browser.container.appendChild(this._audio),
              "play" in this._audio && this._audio.play();
          }),
          (i.stop = function () {
            (this.isStopped = !0),
              SoundManager.removeChannel(this),
              (this.completeHandler = null),
              this._audio &&
                ("pause" in this._audio &&
                  Render.isConchApp &&
                  this._audio.stop(),
                this._audio.pause(),
                this._audio.removeEventListener("ended", this._onEnd),
                this._audio.removeEventListener("canplay", this._resumePlay),
                Browser.onIE ||
                  (this._audio != AudioSound._musicAudio &&
                    Pool.recover("audio:" + this.url, this._audio)),
                Browser.removeElement(this._audio),
                (this._audio = null));
          }),
          (i.pause = function () {
            (this.isStopped = !0),
              SoundManager.removeChannel(this),
              "pause" in this._audio && this._audio.pause();
          }),
          (i.resume = function () {
            this._audio &&
              ((this.isStopped = !1),
              SoundManager.addChannel(this),
              "play" in this._audio && this._audio.play());
          }),
          __getset(0, i, "position", function () {
            return this._audio ? this._audio.currentTime : 0;
          }),
          __getset(0, i, "duration", function () {
            return this._audio ? this._audio.duration : 0;
          }),
          __getset(
            0,
            i,
            "volume",
            function () {
              return this._audio ? this._audio.volume : 1;
            },
            function (t) {
              this._audio && (this._audio.volume = t);
            }
          ),
          e
        );
      })(),
      WebAudioSoundChannel = (function (t) {
        function e() {
          (this.audioBuffer = null),
            (this.gain = null),
            (this.bufferSource = null),
            (this._currentTime = 0),
            (this._volume = 1),
            (this._startTime = 0),
            (this._pauseTime = 0),
            (this._onPlayEnd = null),
            (this.context = WebAudioSound.ctx),
            e.__super.call(this),
            (this._onPlayEnd = Utils.bind(this.__onPlayEnd, this)),
            this.context.createGain
              ? (this.gain = this.context.createGain())
              : (this.gain = this.context.createGainNode());
        }
        __class(e, "laya.media.webaudio.WebAudioSoundChannel", SoundChannel);
        var i = e.prototype;
        return (
          (i.play = function () {
            if (
              (SoundManager.addChannel(this),
              (this.isStopped = !1),
              this._clearBufferSource(),
              this.audioBuffer)
            ) {
              var t = this.context,
                e = this.gain,
                i = t.createBufferSource();
              (this.bufferSource = i),
                (i.buffer = this.audioBuffer),
                i.connect(e),
                e && e.disconnect(),
                e.connect(t.destination),
                (i.onended = this._onPlayEnd),
                this.startTime >= this.duration && (this.startTime = 0),
                (this._startTime = Browser.now()),
                (this.gain.gain.value = this._volume),
                0 == this.loops && (i.loop = !0),
                (i.playbackRate.value = SoundManager.playbackRate),
                i.start(0, this.startTime),
                (this._currentTime = 0);
            }
          }),
          (i.__onPlayEnd = function () {
            if (1 == this.loops)
              return (
                this.completeHandler &&
                  (Laya.timer.once(
                    10,
                    this,
                    this.__runComplete,
                    [this.completeHandler],
                    !1
                  ),
                  (this.completeHandler = null)),
                this.stop(),
                void this.event("complete")
              );
            this.loops > 0 && this.loops--, (this.startTime = 0), this.play();
          }),
          (i._clearBufferSource = function () {
            if (this.bufferSource) {
              var t = this.bufferSource;
              t.stop ? t.stop(0) : t.noteOff(0),
                t.disconnect(0),
                (t.onended = null),
                e._tryCleanFailed || this._tryClearBuffer(t),
                (this.bufferSource = null);
            }
          }),
          (i._tryClearBuffer = function (t) {
            if (Browser.onMac)
              try {
                t.buffer = WebAudioSound._miniBuffer;
              } catch (t) {
                e._tryCleanFailed = !0;
              }
            else
              try {
                t.buffer = null;
              } catch (t) {
                e._tryCleanFailed = !0;
              }
          }),
          (i.stop = function () {
            this._clearBufferSource(),
              (this.audioBuffer = null),
              this.gain && this.gain.disconnect(),
              (this.isStopped = !0),
              SoundManager.removeChannel(this),
              (this.completeHandler = null),
              SoundManager.autoReleaseSound &&
                Laya.timer.once(
                  5e3,
                  null,
                  SoundManager.disposeSoundIfNotUsed,
                  [this.url],
                  !1
                );
          }),
          (i.pause = function () {
            this.isStopped || (this._pauseTime = this.position),
              this._clearBufferSource(),
              this.gain && this.gain.disconnect(),
              (this.isStopped = !0),
              SoundManager.removeChannel(this),
              SoundManager.autoReleaseSound &&
                Laya.timer.once(
                  5e3,
                  null,
                  SoundManager.disposeSoundIfNotUsed,
                  [this.url],
                  !1
                );
          }),
          (i.resume = function () {
            (this.startTime = this._pauseTime), this.play();
          }),
          __getset(0, i, "position", function () {
            return this.bufferSource
              ? (Browser.now() - this._startTime) / 1e3 + this.startTime
              : 0;
          }),
          __getset(0, i, "duration", function () {
            return this.audioBuffer ? this.audioBuffer.duration : 0;
          }),
          __getset(
            0,
            i,
            "volume",
            function () {
              return this._volume;
            },
            function (t) {
              this.isStopped ||
                ((this._volume = t), (this.gain.gain.value = t));
            }
          ),
          (e._tryCleanFailed = !1),
          e
        );
      })(),
      Bitmap = (function (t) {
        function e() {
          e.__super.call(this), (this._w = 0), (this._h = 0);
        }
        __class(e, "laya.resource.Bitmap", Resource);
        var i = e.prototype;
        return (
          __getset(0, i, "width", function () {
            return this._w;
          }),
          __getset(0, i, "height", function () {
            return this._h;
          }),
          __getset(0, i, "source", function () {
            return this._source;
          }),
          e
        );
      })(),
      AnimationPlayerBase = (function (t) {
        function e() {
          (this.loop = !1),
            (this.wrapMode = 0),
            (this._index = 0),
            (this._count = 0),
            (this._isPlaying = !1),
            (this._labels = null),
            (this._isReverse = !1),
            (this._frameRateChanged = !1),
            (this._controlNode = null),
            (this._actionName = null),
            e.__super.call(this),
            (this._interval = Config.animationInterval),
            this._setUpNoticeType(1);
        }
        __class(e, "laya.display.AnimationPlayerBase", t);
        var i = e.prototype;
        return (
          (i.play = function (t, e, i, n) {
            void 0 === t && (t = 0),
              void 0 === e && (e = !0),
              void 0 === i && (i = ""),
              void 0 === n && (n = !0),
              (this._isPlaying = !0),
              (this.index =
                "string" == typeof t ? this._getFrameByLabel(t) : t),
              (this.loop = e),
              (this._actionName = i),
              (this._isReverse = 1 == this.wrapMode),
              this.interval > 0 &&
                this.timerLoop(
                  this.interval,
                  this,
                  this._frameLoop,
                  null,
                  !0,
                  !0
                );
          }),
          (i._getFrameByLabel = function (t) {
            var e = 0;
            for (e = 0; e < this._count; e++)
              if (this._labels[e] && this._labels[e].indexOf(t) >= 0) return e;
            return 0;
          }),
          (i._frameLoop = function () {
            if (this._isReverse) {
              if ((this._index--, this._index < 0)) {
                if (!this.loop)
                  return (
                    (this._index = 0), this.stop(), void this.event("complete")
                  );
                2 == this.wrapMode
                  ? ((this._index = this._count > 0 ? 1 : 0),
                    (this._isReverse = !1))
                  : (this._index = this._count - 1),
                  this.event("complete");
              }
            } else if ((this._index++, this._index >= this._count)) {
              if (!this.loop)
                return this._index--, this.stop(), void this.event("complete");
              2 == this.wrapMode
                ? ((this._index = this._count - 2 >= 0 ? this._count - 2 : 0),
                  (this._isReverse = !0))
                : (this._index = 0),
                this.event("complete");
            }
            this.index = this._index;
          }),
          (i._setControlNode = function (t) {
            this._controlNode &&
              (this._controlNode.off("display", this, this._checkResumePlaying),
              this._controlNode.off(
                "undisplay",
                this,
                this._checkResumePlaying
              )),
              (this._controlNode = t),
              t &&
                t != this &&
                (t.on("display", this, this._checkResumePlaying),
                t.on("undisplay", this, this._checkResumePlaying));
          }),
          (i._setDisplay = function (e) {
            t.prototype._setDisplay.call(this, e), this._checkResumePlaying();
          }),
          (i._checkResumePlaying = function () {
            this._isPlaying &&
              (this._controlNode.displayedInStage
                ? this.play(this._index, this.loop, this._actionName)
                : this.clearTimer(this, this._frameLoop));
          }),
          (i.stop = function () {
            (this._isPlaying = !1), this.clearTimer(this, this._frameLoop);
          }),
          (i.addLabel = function (t, e) {
            this._labels || (this._labels = {}),
              this._labels[e] || (this._labels[e] = []),
              this._labels[e].push(t);
          }),
          (i.removeLabel = function (t) {
            if (t) {
              if (this._labels)
                for (var e in this._labels)
                  this._removeLabelFromLabelList(this._labels[e], t);
            } else this._labels = null;
          }),
          (i._removeLabelFromLabelList = function (t, e) {
            if (t)
              for (var i = t.length - 1; i >= 0; i--)
                t[i] == e && t.splice(i, 1);
          }),
          (i.gotoAndStop = function (t) {
            (this.index = "string" == typeof t ? this._getFrameByLabel(t) : t),
              this.stop();
          }),
          (i._displayToIndex = function (t) {}),
          (i.clear = function () {
            this.stop(), (this._labels = null);
          }),
          __getset(
            0,
            i,
            "interval",
            function () {
              return this._interval;
            },
            function (t) {
              this._interval != t &&
                ((this._frameRateChanged = !0),
                (this._interval = t),
                this._isPlaying &&
                  t > 0 &&
                  this.timerLoop(t, this, this._frameLoop, null, !0, !0));
            }
          ),
          __getset(0, i, "isPlaying", function () {
            return this._isPlaying;
          }),
          __getset(
            0,
            i,
            "index",
            function () {
              return this._index;
            },
            function (t) {
              if (
                ((this._index = t),
                this._displayToIndex(t),
                this._labels && this._labels[t])
              )
                for (var e = this._labels[t], i = 0, n = e.length; i < n; i++)
                  this.event("label", e[i]);
            }
          ),
          __getset(0, i, "count", function () {
            return this._count;
          }),
          (e.WRAP_POSITIVE = 0),
          (e.WRAP_REVERSE = 1),
          (e.WRAP_PINGPONG = 2),
          e
        );
      })(Sprite),
      Text = (function (t) {
        function e() {
          (this._clipPoint = null),
            (this._currBitmapFont = null),
            (this._text = null),
            (this._isChanged = !1),
            (this._textWidth = 0),
            (this._textHeight = 0),
            (this._lines = []),
            (this._lineWidths = []),
            (this._startX = NaN),
            (this._startY = NaN),
            (this._lastVisibleLineIndex = -1),
            (this._words = null),
            (this._charSize = {}),
            (this.underline = !1),
            (this._underlineColor = null),
            e.__super.call(this),
            (this.overflow = e.VISIBLE),
            (this._style = new CSSStyle(this)),
            (this._style.wordWrap = !1);
        }
        __class(e, "laya.display.Text", t);
        var i = e.prototype;
        return (
          (i.destroy = function (e) {
            void 0 === e && (e = !0),
              t.prototype.destroy.call(this, e),
              (this._lines = null),
              this._words && ((this._words.length = 0), (this._words = null));
          }),
          (i._getBoundPointsM = function (t) {
            void 0 === t && (t = !1);
            var e = Rectangle.TEMP;
            return e.setTo(0, 0, this.width, this.height), e._getBoundPoints();
          }),
          (i.getGraphicBounds = function (t) {
            void 0 === t && (t = !1);
            var e = Rectangle.TEMP;
            return e.setTo(0, 0, this.width, this.height), e;
          }),
          (i._getCSSStyle = function () {
            return this._style;
          }),
          (i.lang = function (t, i, n, s, r, a, o, h, l, c, u) {
            if (
              ((t = e.langPacks && e.langPacks[t] ? e.langPacks[t] : t),
              arguments.length < 2)
            )
              this._text = t;
            else {
              for (var _ = 0, d = arguments.length; _ < d; _++)
                t = t.replace("{" + _ + "}", arguments[_ + 1]);
              this._text = t;
            }
          }),
          (i._isPassWordMode = function () {
            var t = this._style.password;
            return "prompt" in this && this.prompt == this._text && (t = !1), t;
          }),
          (i._getPassWordTxt = function (t) {
            var e;
            e = "";
            for (var i = t.length; i > 0; i--) e += "●";
            return e;
          }),
          (i.renderText = function (t, e) {
            var i = this.graphics;
            i.clear(!0);
            var n =
              (this.italic ? "italic " : "") +
              (this.bold ? "bold " : "") +
              this.fontSize +
              "px " +
              (Browser.onIPhone
                ? laya.display.Text._fontFamilyMap[this.font] || this.font
                : this.font);
            Browser.context.font = n;
            var s = this.padding,
              r = s[3],
              a = "left",
              o = this._lines,
              h = this.leading + this._charSize.height,
              l = this._currBitmapFont;
            l && (h = this.leading + l.getMaxHeight());
            var c = s[0];
            if (
              (!l &&
                this._width > 0 &&
                this._textWidth <= this._width &&
                ("right" == this.align
                  ? ((a = "right"), (r = this._width - s[1]))
                  : "center" == this.align &&
                    ((a = "center"), (r = 0.5 * this._width + s[3] - s[1]))),
              this._height > 0)
            ) {
              var u = this._textHeight > this._height ? "top" : this.valign;
              "middle" === u
                ? (c = 0.5 * (this._height - e * h) + s[0] - s[2])
                : "bottom" === u && (c = this._height - e * h - s[2]);
            }
            var _ = this._style;
            if (l && l.autoScaleSize) var d = l.fontSize / this.fontSize;
            if (this._clipPoint)
              if ((i.save(), l && l.autoScaleSize)) {
                var f = 0,
                  p = 0;
                (f = this._width ? this._width - s[3] - s[1] : this._textWidth),
                  (p = this._height
                    ? this._height - s[0] - s[2]
                    : this._textHeight),
                  (f *= d),
                  (p *= d),
                  i.clipRect(s[3], s[0], f, p);
              } else
                i.clipRect(
                  s[3],
                  s[0],
                  this._width ? this._width - s[3] - s[1] : this._textWidth,
                  this._height ? this._height - s[0] - s[2] : this._textHeight
                );
            var g = _.password;
            "prompt" in this && this.prompt == this._text && (g = !1);
            for (
              var m = 0,
                v = 0,
                y = Math.min(this._lines.length, e + t) || 1,
                w = t;
              w < y;
              w++
            ) {
              var x,
                T = o[w];
              if (g) {
                var b = T.length;
                T = "";
                for (var C = b; C > 0; C--) T += "●";
              }
              if (
                ((m = r - (this._clipPoint ? this._clipPoint.x : 0)),
                (v = c + h * w - (this._clipPoint ? this._clipPoint.y : 0)),
                this.underline && this.drawUnderline(a, m, v, w),
                l)
              ) {
                var M = this.width;
                l.autoScaleSize && (M = this.width * d),
                  l.drawText(T, this, m, v, this.align, M);
              } else
                Render.isWebGL
                  ? (this._words || (this._words = []),
                    (x =
                      this._words.length > w - t
                        ? this._words[w - t]
                        : new WordText()).setText(T))
                  : (x = T),
                  _.stroke
                    ? i.fillBorderText(
                        x,
                        m,
                        v,
                        n,
                        this.color,
                        _.strokeColor,
                        _.stroke,
                        a
                      )
                    : i.fillText(x, m, v, n, this.color, a);
            }
            if (l && l.autoScaleSize) {
              var S = 1 / d;
              this.scale(S, S);
            }
            this._clipPoint && i.restore(),
              (this._startX = r),
              (this._startY = c);
          }),
          (i.drawUnderline = function (t, e, i, n) {
            var s = this._lineWidths[n];
            switch (t) {
              case "center":
                e -= s / 2;
                break;
              case "right":
                e -= s;
            }
            (i += this._charSize.height),
              this._graphics.drawLine(
                e,
                i,
                e + s,
                i,
                this.underlineColor || this.color,
                1
              );
          }),
          (i.typeset = function () {
            if (((this._isChanged = !1), !this._text))
              return (
                (this._clipPoint = null),
                (this._textWidth = this._textHeight = 0),
                void this.graphics.clear(!0)
              );
            (Browser.context.font = this._getCSSStyle().font),
              (this._lines.length = 0),
              (this._lineWidths.length = 0),
              this._isPassWordMode()
                ? this.parseLines(this._getPassWordTxt(this._text))
                : this.parseLines(this._text),
              this.evalTextSize(),
              this.checkEnabledViewportOrNot()
                ? this._clipPoint || (this._clipPoint = new Point(0, 0))
                : (this._clipPoint = null);
            var t = this._lines.length;
            if (this.overflow != e.VISIBLE) {
              var i = this.overflow == e.HIDDEN ? Math.floor : Math.ceil;
              t = Math.min(
                t,
                i(
                  (this.height - this.padding[0] - this.padding[2]) /
                    (this.leading + this._charSize.height)
                )
              );
            }
            var n = (this.scrollY / (this._charSize.height + this.leading)) | 0;
            this.renderText(n, t), this.repaint();
          }),
          (i.evalTextSize = function () {
            var t = NaN,
              e = NaN;
            (t = Math.max.apply(this, this._lineWidths)),
              (e = this._currBitmapFont
                ? this._lines.length *
                    (this._currBitmapFont.getMaxHeight() + this.leading) +
                  this.padding[0] +
                  this.padding[2]
                : this._lines.length * (this._charSize.height + this.leading) +
                  this.padding[0] +
                  this.padding[2]),
              (t == this._textWidth && e == this._textHeight) ||
                ((this._textWidth = t),
                (this._textHeight = e),
                (this._width && this._height) ||
                  (this.conchModel &&
                    this.conchModel.size(
                      this._width || this._textWidth,
                      this._height || this._textHeight
                    )));
          }),
          (i.checkEnabledViewportOrNot = function () {
            return (
              this.overflow == e.SCROLL &&
              ((this._width > 0 && this._textWidth > this._width) ||
                (this._height > 0 && this._textHeight > this._height))
            );
          }),
          (i.changeText = function (t) {
            this._text !== t &&
              (this.lang(t + ""),
              (this._graphics && this._graphics.replaceText(this._text)) ||
                this.typeset());
          }),
          (i.parseLines = function (t) {
            var i = this.wordWrap || this.overflow == e.HIDDEN;
            if (i) var n = this.getWordWrapWidth();
            if (this._currBitmapFont)
              (this._charSize.width = this._currBitmapFont.getMaxWidth()),
                (this._charSize.height = this._currBitmapFont.getMaxHeight());
            else {
              var s = Browser.context.measureText(e._testWord);
              (this._charSize.width = s.width),
                (this._charSize.height = s.height || this.fontSize);
            }
            for (
              var r = t.replace(/\r\n/g, "\n").split("\n"), a = 0, o = r.length;
              a < o;
              a++
            ) {
              var h = r[a];
              i
                ? this.parseLine(h, n)
                : (this._lineWidths.push(this.getTextWidth(h)),
                  this._lines.push(h));
            }
          }),
          (i.parseLine = function (t, i) {
            Browser.context;
            var n,
              s = this._lines,
              r = 0,
              a = NaN,
              o = NaN,
              h = 0;
            if ((a = this.getTextWidth(t)) <= i)
              return s.push(t), void this._lineWidths.push(a);
            (a = this._charSize.width),
              0 == (r = Math.floor(i / a)) && (r = 1),
              (o = a = this.getTextWidth(t.substring(0, r)));
            for (var l = r, c = t.length; l < c; l++)
              if (((a = this.getTextWidth(t.charAt(l))), (o += a) > i))
                if (this.wordWrap) {
                  var u = t.substring(h, l);
                  if (
                    (u.charCodeAt(u.length - 1) < 255
                      ? (n = /(?:\w|-)+$/.exec(u)) &&
                        ((l = n.index + h),
                        0 == n.index
                          ? (l += u.length)
                          : (u = t.substring(h, l)))
                      : e.RightToLeft &&
                        (n = /([\u0600-\u06FF])+$/.exec(u)) &&
                        ((l = n.index + h),
                        0 == n.index
                          ? (l += u.length)
                          : (u = t.substring(h, l))),
                    s.push(u),
                    this._lineWidths.push(o - a),
                    (h = l),
                    !(l + r < c))
                  ) {
                    s.push(t.substring(h, c)),
                      this._lineWidths.push(this.getTextWidth(s[s.length - 1])),
                      (h = -1);
                    break;
                  }
                  (l += r), (o = a = this.getTextWidth(t.substring(h, l))), l--;
                } else if (this.overflow == e.HIDDEN)
                  return (
                    s.push(t.substring(0, l)),
                    void this._lineWidths.push(
                      this.getTextWidth(s[s.length - 1])
                    )
                  );
            this.wordWrap &&
              -1 != h &&
              (s.push(t.substring(h, c)),
              this._lineWidths.push(this.getTextWidth(s[s.length - 1])));
          }),
          (i.getTextWidth = function (t) {
            return this._currBitmapFont
              ? this._currBitmapFont.getTextWidth(t)
              : Browser.context.measureText(t).width;
          }),
          (i.getWordWrapWidth = function () {
            var t = this.padding,
              e = NaN;
            return (
              (e =
                this._currBitmapFont && this._currBitmapFont.autoScaleSize
                  ? this._width *
                    (this._currBitmapFont.fontSize / this.fontSize)
                  : this._width) <= 0 &&
                (e = this.wordWrap ? 100 : Browser.width),
              e <= 0 && (e = 100),
              e - t[3] - t[1]
            );
          }),
          (i.getCharPoint = function (t, e) {
            this._isChanged && Laya.timer.runCallLater(this, this.typeset);
            for (
              var i = 0, n = this._lines, s = 0, r = 0, a = n.length;
              r < a;
              r++
            ) {
              if (((i += n[r].length), t < i)) {
                var o = r;
                break;
              }
              s = i;
            }
            var h =
              (this.italic ? "italic " : "") +
              (this.bold ? "bold " : "") +
              this.fontSize +
              "px " +
              this.font;
            Browser.context.font = h;
            var l = this.getTextWidth(this._text.substring(s, t));
            return (e || new Point()).setTo(
              this._startX + l - (this._clipPoint ? this._clipPoint.x : 0),
              this._startY +
                o * (this._charSize.height + this.leading) -
                (this._clipPoint ? this._clipPoint.y : 0)
            );
          }),
          __getset(
            0,
            i,
            "width",
            function () {
              return this._width
                ? this._width
                : this.textWidth + this.padding[1] + this.padding[3];
            },
            function (t) {
              t != this._width &&
                (Laya.superSet(Sprite, this, "width", t),
                (this.isChanged = !0));
            }
          ),
          __getset(0, i, "textWidth", function () {
            return (
              this._isChanged && Laya.timer.runCallLater(this, this.typeset),
              this._textWidth
            );
          }),
          __getset(
            0,
            i,
            "height",
            function () {
              return this._height
                ? this._height
                : this.textHeight + this.padding[0] + this.padding[2];
            },
            function (t) {
              t != this._height &&
                (Laya.superSet(Sprite, this, "height", t),
                (this.isChanged = !0));
            }
          ),
          __getset(0, i, "textHeight", function () {
            return (
              this._isChanged && Laya.timer.runCallLater(this, this.typeset),
              this._textHeight
            );
          }),
          __getset(
            0,
            i,
            "padding",
            function () {
              return this._getCSSStyle().padding;
            },
            function (t) {
              (this._getCSSStyle().padding = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "bold",
            function () {
              return this._getCSSStyle().bold;
            },
            function (t) {
              (this._getCSSStyle().bold = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "text",
            function () {
              return this._text || "";
            },
            function (t) {
              this._text !== t &&
                (this.lang(t + ""),
                (this.isChanged = !0),
                this.event("change"));
            }
          ),
          __getset(
            0,
            i,
            "color",
            function () {
              return this._getCSSStyle().color;
            },
            function (t) {
              this._getCSSStyle().color != t &&
                ((this._getCSSStyle().color = t),
                !this._isChanged && this._graphics
                  ? this._graphics.replaceTextColor(this.color)
                  : (this.isChanged = !0));
            }
          ),
          __getset(
            0,
            i,
            "font",
            function () {
              return this._getCSSStyle().fontFamily;
            },
            function (t) {
              this._currBitmapFont &&
                ((this._currBitmapFont = null), this.scale(1, 1)),
                e._bitmapFonts &&
                  e._bitmapFonts[t] &&
                  (this._currBitmapFont = e._bitmapFonts[t]),
                (this._getCSSStyle().fontFamily = t),
                (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "fontSize",
            function () {
              return this._getCSSStyle().fontSize;
            },
            function (t) {
              (this._getCSSStyle().fontSize = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "italic",
            function () {
              return this._getCSSStyle().italic;
            },
            function (t) {
              (this._getCSSStyle().italic = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "align",
            function () {
              return this._getCSSStyle().align;
            },
            function (t) {
              (this._getCSSStyle().align = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "valign",
            function () {
              return this._getCSSStyle().valign;
            },
            function (t) {
              (this._getCSSStyle().valign = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "wordWrap",
            function () {
              return this._getCSSStyle().wordWrap;
            },
            function (t) {
              (this._getCSSStyle().wordWrap = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "leading",
            function () {
              return this._getCSSStyle().leading;
            },
            function (t) {
              (this._getCSSStyle().leading = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "bgColor",
            function () {
              return this._getCSSStyle().backgroundColor;
            },
            function (t) {
              (this._getCSSStyle().backgroundColor = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "borderColor",
            function () {
              return this._getCSSStyle().borderColor;
            },
            function (t) {
              (this._getCSSStyle().borderColor = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "stroke",
            function () {
              return this._getCSSStyle().stroke;
            },
            function (t) {
              (this._getCSSStyle().stroke = t), (this.isChanged = !0);
            }
          ),
          __getset(
            0,
            i,
            "strokeColor",
            function () {
              return this._getCSSStyle().strokeColor;
            },
            function (t) {
              (this._getCSSStyle().strokeColor = t), (this.isChanged = !0);
            }
          ),
          __getset(0, i, "isChanged", null, function (t) {
            this._isChanged !== t &&
              ((this._isChanged = t),
              t && Laya.timer.callLater(this, this.typeset));
          }),
          __getset(
            0,
            i,
            "scrollX",
            function () {
              return this._clipPoint ? this._clipPoint.x : 0;
            },
            function (t) {
              if (
                !(this.overflow != e.SCROLL || this.textWidth < this._width) &&
                this._clipPoint
              ) {
                t = t < this.padding[3] ? this.padding[3] : t;
                var i = this._textWidth - this._width;
                t = t > i ? i : t;
                var n =
                  (this._height / (this._charSize.height + this.leading)) | 1;
                (this._clipPoint.x = t),
                  this.renderText(this._lastVisibleLineIndex, n);
              }
            }
          ),
          __getset(
            0,
            i,
            "scrollY",
            function () {
              return this._clipPoint ? this._clipPoint.y : 0;
            },
            function (t) {
              if (
                !(
                  this.overflow != e.SCROLL || this.textHeight < this._height
                ) &&
                this._clipPoint
              ) {
                t = t < this.padding[0] ? this.padding[0] : t;
                var i = this._textHeight - this._height,
                  n =
                    ((t = t > i ? i : t) /
                      (this._charSize.height + this.leading)) |
                    0;
                this._lastVisibleLineIndex = n;
                var s =
                  1 +
                  ((this._height / (this._charSize.height + this.leading)) | 0);
                (this._clipPoint.y = t), this.renderText(n, s);
              }
            }
          ),
          __getset(0, i, "maxScrollX", function () {
            return this.textWidth < this._width
              ? 0
              : this._textWidth - this._width;
          }),
          __getset(0, i, "maxScrollY", function () {
            return this.textHeight < this._height
              ? 0
              : this._textHeight - this._height;
          }),
          __getset(0, i, "lines", function () {
            return this._isChanged && this.typeset(), this._lines;
          }),
          __getset(
            0,
            i,
            "underlineColor",
            function () {
              return this._underlineColor;
            },
            function (t) {
              (this._underlineColor = t),
                (this._isChanged = !0),
                this.typeset();
            }
          ),
          (e.registerBitmapFont = function (t, i) {
            e._bitmapFonts || (e._bitmapFonts = {}), (e._bitmapFonts[t] = i);
          }),
          (e.unregisterBitmapFont = function (t, i) {
            if (
              (void 0 === i && (i = !0), e._bitmapFonts && e._bitmapFonts[t])
            ) {
              var n = e._bitmapFonts[t];
              i && n.destroy(), delete e._bitmapFonts[t];
            }
          }),
          (e.setTextRightToLeft = function () {
            var t;
            ((t = Browser.canvas.source.style).display = "none"),
              (t.position = "absolute"),
              (t.direction = "rtl"),
              (Render._mainCanvas.source.style.direction = "rtl"),
              (laya.display.Text.RightToLeft = !0),
              Browser.document.body.appendChild(Browser.canvas.source);
          }),
          (e.supportFont = function (t) {
            Browser.context.font = "10px sans-serif";
            var e = Browser.context.measureText("abcji").width;
            Browser.context.font = "10px " + t;
            var i = Browser.context.measureText("abcji").width;
            return console.log(e, i), e !== i;
          }),
          (e._testWord = "游"),
          (e.langPacks = null),
          (e.VISIBLE = "visible"),
          (e.SCROLL = "scroll"),
          (e.HIDDEN = "hidden"),
          (e.CharacterCache = !0),
          (e.RightToLeft = !1),
          (e._bitmapFonts = null),
          __static(e, [
            "_fontFamilyMap",
            function () {
              return (this._fontFamilyMap = {
                报隶: "报隶-简",
                黑体: "黑体-简",
                楷体: "楷体-简",
                兰亭黑: "兰亭黑-简",
                隶变: "隶变-简",
                凌慧体: "凌慧体-简",
                翩翩体: "翩翩体-简",
                苹方: "苹方-简",
                手札体: "手札体-简",
                宋体: "宋体-简",
                娃娃体: "娃娃体-简",
                魏碑: "魏碑-简",
                行楷: "行楷-简",
                雅痞: "雅痞-简",
                圆体: "圆体-简",
              });
            },
          ]),
          e
        );
      })(Sprite),
      Stage = (function (t) {
        function e() {
          (this.focus = null),
            (this.designWidth = 0),
            (this.designHeight = 0),
            (this.canvasRotation = !1),
            (this.canvasDegree = 0),
            (this.renderingEnabled = !0),
            (this.screenAdaptationEnabled = !0),
            (this._screenMode = "none"),
            (this._scaleMode = "noscale"),
            (this._alignV = "top"),
            (this._alignH = "left"),
            (this._bgColor = "black"),
            (this._mouseMoveTime = 0),
            (this._renderCount = 0),
            (this._frameStartTime = NaN),
            (this._isFocused = !1),
            (this._isVisibility = !1),
            (this._scenes = null),
            (this._frameRate = "fast"),
            e.__super.call(this),
            (this.offset = new Point()),
            (this._canvasTransform = new Matrix()),
            (this._previousOrientation = Browser.window.orientation);
          var t = this;
          (this.transform = Matrix.create()),
            (this._scenes = []),
            (this.mouseEnabled = !0),
            (this.hitTestPrior = !0),
            (this.autoSize = !1),
            (this._displayedInStage = !0),
            (this._isFocused = !0),
            (this._isVisibility = !0);
          var i = Browser.window,
            n = this;
          i.addEventListener("focus", function () {
            (t._isFocused = !0), n.event("focus"), n.event("focuschange");
          }),
            i.addEventListener("blur", function () {
              (t._isFocused = !1),
                n.event("blur"),
                n.event("focuschange"),
                n._isInputting() && (Input.inputElement.target.focus = !1);
            });
          var s = "visibilityState",
            r = "visibilitychange",
            a = i.document;
          void 0 !== a.hidden
            ? ((r = "visibilitychange"), (s = "visibilityState"))
            : void 0 !== a.mozHidden
            ? ((r = "mozvisibilitychange"), (s = "mozVisibilityState"))
            : void 0 !== a.msHidden
            ? ((r = "msvisibilitychange"), (s = "msVisibilityState"))
            : void 0 !== a.webkitHidden &&
              ((r = "webkitvisibilitychange"), (s = "webkitVisibilityState")),
            i.document.addEventListener(r, function () {
              "hidden" == Browser.document[s]
                ? n._setStageVisible(!1)
                : n._setStageVisible(!0);
            }),
            i.document.addEventListener(
              "qbrowserVisibilityChange",
              function (t) {
                n._setStageVisible(!t.hidden);
              }
            ),
            i.addEventListener("resize", function () {
              var e = Browser.window.orientation;
              null != e &&
                e != t._previousOrientation &&
                n._isInputting() &&
                (Input.inputElement.target.focus = !1),
                (t._previousOrientation = e),
                n._isInputting() || n._resetCanvas();
            }),
            i.addEventListener("orientationchange", function (t) {
              n._resetCanvas();
            }),
            this.on("mousemove", this, this._onmouseMove),
            Browser.onMobile && this.on("mousedown", this, this._onmouseMove);
        }
        __class(e, "laya.display.Stage", t);
        var i = e.prototype;
        return (
          (i._setStageVisible = function (t) {
            this._isVisibility != t &&
              ((this._isVisibility = t),
              this._isVisibility ||
                (this._isInputting() && (Input.inputElement.target.focus = !1)),
              this.event("visibilitychange"));
          }),
          (i._isInputting = function () {
            return Browser.onMobile && Input.isInputting;
          }),
          (i._changeCanvasSize = function () {
            this.setScreenSize(
              Browser.clientWidth * Browser.pixelRatio,
              Browser.clientHeight * Browser.pixelRatio
            );
          }),
          (i._resetCanvas = function () {
            if (this.screenAdaptationEnabled) {
              var t = Render._mainCanvas;
              t.source.style;
              t.size(1, 1), Laya.timer.once(100, this, this._changeCanvasSize);
            }
          }),
          (i.setScreenSize = function (t, e) {
            var i = !1;
            if ("none" !== this._screenMode) {
              if (
                (i =
                  (t / e < 1 ? "vertical" : "horizontal") !== this._screenMode)
              ) {
                var n = e;
                (e = t), (t = n);
              }
            }
            this.canvasRotation = i;
            var s = Render._mainCanvas,
              r = s.source.style,
              a = this._canvasTransform.identity(),
              o = this._scaleMode,
              h = t / this.designWidth,
              l = e / this.designHeight,
              c = this.designWidth,
              u = this.designHeight,
              _ = t,
              d = e,
              f = Browser.pixelRatio;
            switch (
              ((this._width = this.designWidth),
              (this._height = this.designHeight),
              o)
            ) {
              case "noscale":
                (h = l = 1), (_ = this.designWidth), (d = this.designHeight);
                break;
              case "showall":
                (h = l = Math.min(h, l)),
                  (c = _ = Math.round(this.designWidth * h)),
                  (u = d = Math.round(this.designHeight * l));
                break;
              case "noborder":
                (h = l = Math.max(h, l)),
                  (_ = Math.round(this.designWidth * h)),
                  (d = Math.round(this.designHeight * l));
                break;
              case "full":
                (h = l = 1), (this._width = c = t), (this._height = u = e);
                break;
              case "fixedwidth":
                (l = h), (this._height = u = Math.round(e / h));
                break;
              case "fixedheight":
                (h = l), (this._width = c = Math.round(t / l));
                break;
              case "fixedauto":
                t / e < this.designWidth / this.designHeight
                  ? ((l = h), (this._height = u = Math.round(e / h)))
                  : ((h = l), (this._width = c = Math.round(t / l)));
            }
            this.conchModel && this.conchModel.size(this._width, this._height),
              (h *= this.scaleX),
              (l *= this.scaleY),
              1 === h && 1 === l
                ? this.transform.identity()
                : ((this.transform.a = this._formatData(h / (_ / c))),
                  (this.transform.d = this._formatData(l / (d / u))),
                  this.conchModel &&
                    this.conchModel.scale(this.transform.a, this.transform.d)),
              s.size(c, u),
              RunDriver.changeWebGLSize(c, u),
              a.scale(_ / c / f, d / u / f),
              "left" === this._alignH
                ? (this.offset.x = 0)
                : "right" === this._alignH
                ? (this.offset.x = t - _)
                : (this.offset.x = (0.5 * (t - _)) / f),
              "top" === this._alignV
                ? (this.offset.y = 0)
                : "bottom" === this._alignV
                ? (this.offset.y = e - d)
                : (this.offset.y = (0.5 * (e - d)) / f),
              (this.offset.x = Math.round(this.offset.x)),
              (this.offset.y = Math.round(this.offset.y)),
              a.translate(this.offset.x, this.offset.y),
              (this.canvasDegree = 0),
              i &&
                ("horizontal" === this._screenMode
                  ? (a.rotate(Math.PI / 2),
                    a.translate(e / f, 0),
                    (this.canvasDegree = 90))
                  : (a.rotate(-Math.PI / 2),
                    a.translate(0, t / f),
                    (this.canvasDegree = -90))),
              (a.a = this._formatData(a.a)),
              (a.d = this._formatData(a.d)),
              (a.tx = this._formatData(a.tx)),
              (a.ty = this._formatData(a.ty)),
              (r.transformOrigin =
                r.webkitTransformOrigin =
                r.msTransformOrigin =
                r.mozTransformOrigin =
                r.oTransformOrigin =
                  "0px 0px 0px"),
              (r.transform =
                r.webkitTransform =
                r.msTransform =
                r.mozTransform =
                r.oTransform =
                  "matrix(" + a.toString() + ")"),
              a.translate(parseInt(r.left) || 0, parseInt(r.top) || 0),
              (this.visible = !0),
              (this._repaint = 1),
              this.event("resize");
          }),
          (i._formatData = function (t) {
            return Math.abs(t) < 1e-6
              ? 0
              : Math.abs(1 - t) < 0.001
              ? t > 0
                ? 1
                : -1
              : t;
          }),
          (i.getMousePoint = function () {
            return Point.TEMP.setTo(this.mouseX, this.mouseY);
          }),
          (i.repaint = function () {
            this._repaint = 1;
          }),
          (i.parentRepaint = function () {}),
          (i._loop = function () {
            return this.render(Render.context, 0, 0), !0;
          }),
          (i._onmouseMove = function (t) {
            this._mouseMoveTime = Browser.now();
          }),
          (i.getTimeFromFrameStart = function () {
            return Browser.now() - this._frameStartTime;
          }),
          (i.render = function (e, i, n) {
            if ("sleep" === this._frameRate && !Render.isConchApp) {
              var s = Browser.now();
              if (!(s - this._frameStartTime >= 1e3)) return;
              this._frameStartTime = s;
            }
            if (
              (this._renderCount++,
              Render.isFlash && this.repaint(),
              this._style.visible)
            ) {
              this._frameStartTime = Browser.now();
              var r =
                  "slow" !==
                  ("mouse" === this._frameRate
                    ? this._frameStartTime - this._mouseMoveTime < 2e3
                      ? "fast"
                      : "slow"
                    : this._frameRate),
                a = this._renderCount % 2 == 0;
              if (((Stat.renderSlow = !r), r || a || Render.isConchApp)) {
                Stat.loopCount++,
                  MouseManager.instance.runEvent(),
                  Laya.timer._update(),
                  RunDriver.update3DLoop();
                var o,
                  h = 0,
                  l = 0;
                if (Render.isConchNode)
                  for (h = 0, l = this._scenes.length; h < l; h++)
                    (o = this._scenes[h]) && o._updateSceneConch();
                else
                  for (h = 0, l = this._scenes.length; h < l; h++)
                    (o = this._scenes[h]) && o._updateScene();
                if (Render.isConchNode) {
                  var c = Sprite.CustomList;
                  for (h = 0, l = c.length; h < l; h++) {
                    var u = c[h];
                    u.customRender(u.customContext, 0, 0);
                  }
                  return;
                }
              }
              Render.isConchNode ||
                !this.renderingEnabled ||
                (!r && a) ||
                (Render.isWebGL
                  ? (e.clear(),
                    t.prototype.render.call(this, e, i, n),
                    Stat._show && Stat._sp && Stat._sp.render(e, i, n),
                    RunDriver.clear(this._bgColor),
                    RunDriver.beginFlush(),
                    e.flush(),
                    RunDriver.endFinish(),
                    VectorGraphManager.instance &&
                      VectorGraphManager.getInstance().endDispose())
                  : (RunDriver.clear(this._bgColor),
                    t.prototype.render.call(this, e, i, n),
                    Stat._show && Stat._sp && Stat._sp.render(e, i, n)));
            } else
              this._renderCount % 5 == 0 &&
                (Stat.loopCount++,
                MouseManager.instance.runEvent(),
                Laya.timer._update());
          }),
          (i._requestFullscreen = function () {
            var t = Browser.document.documentElement;
            t.requestFullscreen
              ? t.requestFullscreen()
              : t.mozRequestFullScreen
              ? t.mozRequestFullScreen()
              : t.webkitRequestFullscreen
              ? t.webkitRequestFullscreen()
              : t.msRequestFullscreen && t.msRequestFullscreen();
          }),
          (i._fullScreenChanged = function () {
            Laya.stage.event("fullscreenchange");
          }),
          (i.exitFullscreen = function () {
            var t = Browser.document;
            t.exitFullscreen
              ? t.exitFullscreen()
              : t.mozCancelFullScreen
              ? t.mozCancelFullScreen()
              : t.webkitExitFullscreen && t.webkitExitFullscreen();
          }),
          __getset(0, i, "clientScaleX", function () {
            return this._transform ? this._transform.getScaleX() : 1;
          }),
          __getset(0, i, "desginHeight", function () {
            return (
              console.debug("desginHeight已经弃用，请使用designHeight代替"),
              this.designHeight
            );
          }),
          __getset(
            0,
            i,
            "frameRate",
            function () {
              return this._frameRate;
            },
            function (t) {
              if (((this._frameRate = t), Render.isConchApp))
                switch (this._frameRate) {
                  case "slow":
                    Browser.window.conch &&
                      Browser.window.conchConfig.setSlowFrame &&
                      Browser.window.conchConfig.setSlowFrame(!0);
                    break;
                  case "fast":
                    Browser.window.conch &&
                      Browser.window.conchConfig.setSlowFrame &&
                      Browser.window.conchConfig.setSlowFrame(!1);
                    break;
                  case "mouse":
                    Browser.window.conch &&
                      Browser.window.conchConfig.setMouseFrame &&
                      Browser.window.conchConfig.setMouseFrame(2e3);
                    break;
                  case "sleep":
                    Browser.window.conch &&
                      Browser.window.conchConfig.setLimitFPS &&
                      Browser.window.conchConfig.setLimitFPS(1);
                    break;
                  default:
                    throw new Error("Stage:frameRate invalid.");
                }
            }
          ),
          __getset(0, i, "clientScaleY", function () {
            return this._transform ? this._transform.getScaleY() : 1;
          }),
          __getset(0, i, "width", t.prototype._$get_width, function (t) {
            (this.designWidth = t),
              Laya.superSet(Sprite, this, "width", t),
              Laya.timer.callLater(this, this._changeCanvasSize);
          }),
          __getset(
            0,
            i,
            "alignH",
            function () {
              return this._alignH;
            },
            function (t) {
              (this._alignH = t),
                Laya.timer.callLater(this, this._changeCanvasSize);
            }
          ),
          __getset(0, i, "isFocused", function () {
            return this._isFocused;
          }),
          __getset(0, i, "height", t.prototype._$get_height, function (t) {
            (this.designHeight = t),
              Laya.superSet(Sprite, this, "height", t),
              Laya.timer.callLater(this, this._changeCanvasSize);
          }),
          __getset(
            0,
            i,
            "transform",
            function () {
              return (
                this._tfChanged && this._adjustTransform(),
                (this._transform = this._transform || Matrix.create())
              );
            },
            t.prototype._$set_transform
          ),
          __getset(0, i, "isVisibility", function () {
            return this._isVisibility;
          }),
          __getset(0, i, "desginWidth", function () {
            return (
              console.debug("desginWidth已经弃用，请使用designWidth代替"),
              this.designWidth
            );
          }),
          __getset(
            0,
            i,
            "scaleMode",
            function () {
              return this._scaleMode;
            },
            function (t) {
              (this._scaleMode = t),
                Laya.timer.callLater(this, this._changeCanvasSize);
            }
          ),
          __getset(
            0,
            i,
            "alignV",
            function () {
              return this._alignV;
            },
            function (t) {
              (this._alignV = t),
                Laya.timer.callLater(this, this._changeCanvasSize);
            }
          ),
          __getset(
            0,
            i,
            "bgColor",
            function () {
              return this._bgColor;
            },
            function (t) {
              (this._bgColor = t),
                this.conchModel && this.conchModel.bgColor(t),
                Render.isWebGL &&
                  (t && "black" !== t && "#000000" !== t
                    ? (e._wgColor = Color.create(t)._color)
                    : Browser.onMiniGame || (e._wgColor = null)),
                Browser.onLimixiu
                  ? (e._wgColor = Color.create(t)._color)
                  : (Render.canvas.style.background = t || "none");
            }
          ),
          __getset(0, i, "mouseX", function () {
            return Math.round(MouseManager.instance.mouseX / this.clientScaleX);
          }),
          __getset(0, i, "mouseY", function () {
            return Math.round(MouseManager.instance.mouseY / this.clientScaleY);
          }),
          __getset(
            0,
            i,
            "screenMode",
            function () {
              return this._screenMode;
            },
            function (t) {
              this._screenMode = t;
            }
          ),
          __getset(0, i, "visible", t.prototype._$get_visible, function (t) {
            if (this.visible !== t) {
              Laya.superSet(Sprite, this, "visible", t);
              Render._mainCanvas.source.style.visibility = t
                ? "visible"
                : "hidden";
            }
          }),
          __getset(0, i, "fullScreenEnabled", null, function (t) {
            var e = Browser.document,
              i = Render.canvas;
            t
              ? (i.addEventListener("mousedown", this._requestFullscreen),
                i.addEventListener("touchstart", this._requestFullscreen),
                e.addEventListener("fullscreenchange", this._fullScreenChanged),
                e.addEventListener(
                  "mozfullscreenchange",
                  this._fullScreenChanged
                ),
                e.addEventListener(
                  "webkitfullscreenchange",
                  this._fullScreenChanged
                ),
                e.addEventListener(
                  "msfullscreenchange",
                  this._fullScreenChanged
                ))
              : (i.removeEventListener("mousedown", this._requestFullscreen),
                i.removeEventListener("touchstart", this._requestFullscreen),
                e.removeEventListener(
                  "fullscreenchange",
                  this._fullScreenChanged
                ),
                e.removeEventListener(
                  "mozfullscreenchange",
                  this._fullScreenChanged
                ),
                e.removeEventListener(
                  "webkitfullscreenchange",
                  this._fullScreenChanged
                ),
                e.removeEventListener(
                  "msfullscreenchange",
                  this._fullScreenChanged
                ));
          }),
          (e.SCALE_NOSCALE = "noscale"),
          (e.SCALE_EXACTFIT = "exactfit"),
          (e.SCALE_SHOWALL = "showall"),
          (e.SCALE_NOBORDER = "noborder"),
          (e.SCALE_FULL = "full"),
          (e.SCALE_FIXED_WIDTH = "fixedwidth"),
          (e.SCALE_FIXED_HEIGHT = "fixedheight"),
          (e.SCALE_FIXED_AUTO = "fixedauto"),
          (e.ALIGN_LEFT = "left"),
          (e.ALIGN_RIGHT = "right"),
          (e.ALIGN_CENTER = "center"),
          (e.ALIGN_TOP = "top"),
          (e.ALIGN_MIDDLE = "middle"),
          (e.ALIGN_BOTTOM = "bottom"),
          (e.SCREEN_NONE = "none"),
          (e.SCREEN_HORIZONTAL = "horizontal"),
          (e.SCREEN_VERTICAL = "vertical"),
          (e.FRAME_FAST = "fast"),
          (e.FRAME_SLOW = "slow"),
          (e.FRAME_MOUSE = "mouse"),
          (e.FRAME_SLEEP = "sleep"),
          (e._wgColor = null),
          (e.FRAME_MOUSE_THREDHOLD = 2e3),
          e
        );
      })(Sprite),
      SoundNode = (function (t) {
        function e() {
          (this.url = null),
            (this._channel = null),
            (this._tar = null),
            (this._playEvents = null),
            (this._stopEvents = null),
            e.__super.call(this),
            (this.visible = !1),
            this.on("added", this, this._onParentChange),
            this.on("removed", this, this._onParentChange);
        }
        __class(e, "laya.media.SoundNode", Sprite);
        var i = e.prototype;
        return (
          (i._onParentChange = function () {
            this.target = this.parent;
          }),
          (i.play = function (t, e) {
            void 0 === t && (t = 1),
              isNaN(t) && (t = 1),
              this.url &&
                (this.stop(),
                (this._channel = SoundManager.playSound(this.url, t, e)));
          }),
          (i.stop = function () {
            this._channel && !this._channel.isStopped && this._channel.stop(),
              (this._channel = null);
          }),
          (i._setPlayAction = function (t, e, i, n) {
            void 0 === n && (n = !0),
              this[i] &&
                t &&
                (n ? t.on(e, this, this[i]) : t.off(e, this, this[i]));
          }),
          (i._setPlayActions = function (t, e, i, n) {
            if ((void 0 === n && (n = !0), t && e)) {
              var s = e.split(","),
                r = 0,
                a = 0;
              for (a = s.length, r = 0; r < a; r++)
                this._setPlayAction(t, s[r], i, n);
            }
          }),
          __getset(0, i, "playEvent", null, function (t) {
            (this._playEvents = t),
              t && this._tar && this._setPlayActions(this._tar, t, "play");
          }),
          __getset(0, i, "target", null, function (t) {
            this._tar &&
              (this._setPlayActions(this._tar, this._playEvents, "play", !1),
              this._setPlayActions(this._tar, this._stopEvents, "stop", !1)),
              (this._tar = t),
              this._tar &&
                (this._setPlayActions(this._tar, this._playEvents, "play", !0),
                this._setPlayActions(this._tar, this._stopEvents, "stop", !0));
          }),
          __getset(0, i, "stopEvent", null, function (t) {
            (this._stopEvents = t),
              t && this._tar && this._setPlayActions(this._tar, t, "stop");
          }),
          e
        );
      })(),
      FileBitmap = (function (t) {
        function e() {
          (this._src = null),
            (this._onload = null),
            (this._onerror = null),
            e.__super.call(this);
        }
        __class(e, "laya.resource.FileBitmap", Bitmap);
        var i = e.prototype;
        return (
          __getset(
            0,
            i,
            "src",
            function () {
              return this._src;
            },
            function (t) {
              this._src = t;
            }
          ),
          __getset(0, i, "onload", null, function (t) {}),
          __getset(0, i, "onerror", null, function (t) {}),
          e
        );
      })(),
      HTMLCanvas = (function (t) {
        function e(t, i) {
          (this._is2D = !1), e.__super.call(this);
          var n = this;
          if (
            ((this._source = this),
            "2D" === t || ("AUTO" === t && !Render.isWebGL))
          ) {
            (this._is2D = !0),
              (this._source = i || Browser.createElement("canvas")),
              (this._w = this._source.width),
              (this._h = this._source.height);
            var s = this;
            s.getContext = function (t, e) {
              if (n._ctx) return n._ctx;
              var i = (n._ctx = n._source.getContext(t, e));
              return (
                i &&
                  ((i._canvas = s),
                  Render.isFlash ||
                    Browser.onLimixiu ||
                    (i.size = function (t, e) {})),
                i
              );
            };
          }
          this.lock = !0;
        }
        __class(e, "laya.resource.HTMLCanvas", Bitmap);
        var i = e.prototype;
        return (
          (i.clear = function () {
            this._ctx && this._ctx.clear();
          }),
          (i.destroy = function () {
            this._ctx && this._ctx.destroy(),
              (this._ctx = null),
              laya.resource.Resource.prototype.destroy.call(this);
          }),
          (i.release = function () {}),
          (i._setContext = function (t) {
            this._ctx = t;
          }),
          (i.getContext = function (t, i) {
            return this._ctx ? this._ctx : (this._ctx = e._createContext(this));
          }),
          (i.getMemSize = function () {
            return 0;
          }),
          (i.size = function (t, e) {
            (this._w != t ||
              this._h != e ||
              (this._source &&
                (this._source.width != t || this._source.height != e))) &&
              ((this._w = t),
              (this._h = e),
              (this.memorySize = this._w * this._h * 4),
              this._ctx && this._ctx.size(t, e),
              this._source &&
                ((this._source.height = e), (this._source.width = t)));
          }),
          (i.getCanvas = function () {
            return this._source;
          }),
          (i.toBase64 = function (t, e, i) {
            if (this._source)
              if (Render.isConchApp && this._source.toBase64)
                this._source.toBase64(t, e, i);
              else {
                var n = this._source.toDataURL(t, e);
                i.call(this, n);
              }
          }),
          __getset(0, i, "context", function () {
            return this._ctx;
          }),
          __getset(0, i, "asBitmap", null, function (t) {}),
          (e.create = function (t, i) {
            return new e(t, i);
          }),
          (e.TYPE2D = "2D"),
          (e.TYPE3D = "3D"),
          (e.TYPEAUTO = "AUTO"),
          (e._createContext = null),
          e
        );
      })(),
      HTMLSubImage = (function (t) {
        function e(t, i, n, s, r, a, o, h) {
          throw (e.__super.call(this), new Error("不允许new！"));
        }
        return (
          __class(e, "laya.resource.HTMLSubImage", Bitmap),
          (e.create = function (t, i, n, s, r, a, o, h) {
            return void 0 === h && (h = !1), new e(t, i, n, s, r, a, o, h);
          }),
          e
        );
      })(),
      Animation = (function (t) {
        function e() {
          (this._frames = null),
            (this._url = null),
            e.__super.call(this),
            this._setControlNode(this);
        }
        __class(e, "laya.display.Animation", t);
        var i = e.prototype;
        return (
          (i.destroy = function (t) {
            void 0 === t && (t = !0),
              this.stop(),
              laya.display.Sprite.prototype.destroy.call(this, t),
              (this._frames = null),
              (this._labels = null);
          }),
          (i.play = function (t, e, i, n) {
            void 0 === t && (t = 0),
              void 0 === e && (e = !0),
              void 0 === i && (i = ""),
              void 0 === n && (n = !0),
              i && this._setFramesFromCache(i, n),
              (this._isPlaying = !0),
              (this.index =
                "string" == typeof t ? this._getFrameByLabel(t) : t),
              (this.loop = e),
              (this._actionName = i),
              (this._isReverse = 1 == this.wrapMode),
              this._frames &&
                this.interval > 0 &&
                this.timerLoop(
                  this.interval,
                  this,
                  this._frameLoop,
                  null,
                  !0,
                  !0
                );
          }),
          (i._setFramesFromCache = function (t, i) {
            if (
              (void 0 === i && (i = !1),
              this._url && (t = this._url + "#" + t),
              t && e.framesMap[t])
            ) {
              var n;
              return (
                (n = e.framesMap[t]) instanceof Array
                  ? ((this._frames = e.framesMap[t]),
                    (this._count = this._frames.length))
                  : (n.nodeRoot &&
                      ((e.framesMap[t] = this._parseGraphicAnimationByData(n)),
                      (n = e.framesMap[t])),
                    (this._frames = n.frames),
                    (this._count = this._frames.length),
                    this._frameRateChanged || (this._interval = n.interval),
                    (this._labels = this._copyLabels(n.labels))),
                !0
              );
            }
            return i && console.log("ani not found:", t), !1;
          }),
          (i._copyLabels = function (t) {
            if (!t) return null;
            var e;
            e = {};
            var i;
            for (i in t) e[i] = Utils.copyArray([], t[i]);
            return e;
          }),
          (i._frameLoop = function () {
            this._style.visible &&
              this._style.alpha > 0.01 &&
              t.prototype._frameLoop.call(this);
          }),
          (i._displayToIndex = function (t) {
            this._frames && (this.graphics = this._frames[t]);
          }),
          (i.clear = function () {
            this.stop(),
              (this.graphics = null),
              (this._frames = null),
              (this._labels = null);
          }),
          (i.loadImages = function (t, i) {
            return (
              void 0 === i && (i = ""),
              (this._url = ""),
              this._setFramesFromCache(i) ||
                (this.frames = e.framesMap[i]
                  ? e.framesMap[i]
                  : e.createFrames(t, i)),
              this
            );
          }),
          (i.loadAtlas = function (t, i, n) {
            function s(s) {
              t === s &&
                ((r.frames = e.framesMap[n]
                  ? e.framesMap[n]
                  : e.createFrames(t, n)),
                i && i.run());
            }
            void 0 === n && (n = ""), (this._url = "");
            var r = this;
            return (
              r._setFramesFromCache(n) ||
                (Loader.getAtlas(t)
                  ? s(t)
                  : Laya.loader.load(
                      t,
                      Handler.create(null, s, [t]),
                      null,
                      "atlas"
                    )),
              this
            );
          }),
          (i.loadAnimation = function (t, e, i) {
            this._url = t;
            return (
              this._actionName || (this._actionName = ""),
              this._setFramesFromCache("")
                ? (this._setFramesFromCache(this._actionName, !0),
                  (this.index = 0),
                  e && e.run())
                : !i || Loader.getAtlas(i)
                ? this._loadAnimationData(t, e, i)
                : Laya.loader.load(
                    i,
                    Handler.create(this, this._loadAnimationData, [t, e, i]),
                    null,
                    "atlas"
                  ),
              this
            );
          }),
          (i._loadAnimationData = function (t, i, n) {
            function s(n) {
              if (Loader.getRes(n) && t === n) {
                var s;
                if (e.framesMap[t + "#"])
                  a._setFramesFromCache(r._actionName, !0),
                    (r.index = 0),
                    r._checkResumePlaying();
                else {
                  var o = a._parseGraphicAnimation(Loader.getRes(t));
                  if (!o) return;
                  var h,
                    l = o.animationList,
                    c = 0,
                    u = l.length;
                  for (c = 0; c < u; c++)
                    (s = l[c]),
                      (e.framesMap[t + "#" + s.name] = s),
                      h || (h = s);
                  h &&
                    ((e.framesMap[t + "#"] = h),
                    a._setFramesFromCache(r._actionName, !0),
                    (r.index = 0)),
                    r._checkResumePlaying();
                }
                i && i.run();
              }
            }
            var r = this;
            if (!n || Loader.getAtlas(n)) {
              var a = this;
              Loader.getRes(t)
                ? s(t)
                : Laya.loader.load(
                    t,
                    Handler.create(null, s, [t]),
                    null,
                    "json"
                  ),
                Loader.clearRes(t);
            } else console.warn("atlas load fail:" + n);
          }),
          (i._parseGraphicAnimation = function (t) {
            return GraphicAnimation.parseAnimationData(t);
          }),
          (i._parseGraphicAnimationByData = function (t) {
            return GraphicAnimation.parseAnimationByData(t);
          }),
          __getset(
            0,
            i,
            "frames",
            function () {
              return this._frames;
            },
            function (t) {
              (this._frames = t),
                t &&
                  ((this._count = t.length),
                  this._isPlaying
                    ? this.play(this._index, this.loop, this._actionName)
                    : (this.index = this._index));
            }
          ),
          __getset(0, i, "autoPlay", null, function (t) {
            t ? this.play() : this.stop();
          }),
          __getset(0, i, "source", null, function (t) {
            t.indexOf(".ani") > -1
              ? this.loadAnimation(t)
              : t.indexOf(".json") > -1 ||
                t.indexOf("als") > -1 ||
                t.indexOf("atlas") > -1
              ? this.loadAtlas(t)
              : this.loadImages(t.split(","));
          }),
          __getset(0, i, "autoAnimation", null, function (t) {
            this.play(0, !0, t, !1);
          }),
          (e.createFrames = function (t, i) {
            var n,
              s,
              r = 0,
              a = 0;
            if ("string" == typeof t) {
              var o = Loader.getAtlas(t);
              if (o && o.length)
                for (n = [], r = 0, a = o.length; r < a; r++)
                  (s = new RunDriver.createGraphics()).drawTexture(
                    Loader.getRes(o[r]),
                    0,
                    0
                  ),
                    n.push(s);
            } else if (t instanceof Array)
              for (n = [], r = 0, a = t.length; r < a; r++)
                (s = new RunDriver.createGraphics()).loadImage(t[r], 0, 0),
                  n.push(s);
            return i && (e.framesMap[i] = n), n;
          }),
          (e.clearCache = function (t) {
            var i,
              n = e.framesMap,
              s = t + "#";
            for (i in n)
              (i !== t && 0 != i.indexOf(s)) || delete e.framesMap[i];
          }),
          (e.framesMap = {}),
          e
        );
      })(AnimationPlayerBase),
      FrameAnimation = (function (t) {
        function e() {
          (this._targetDic = null),
            (this._animationData = null),
            (this._animationNewFrames = null),
            e.__super.call(this),
            null == e._sortIndexFun &&
              (e._sortIndexFun = MathUtil.sortByKey("index", !1, !0));
        }
        __class(e, "laya.display.FrameAnimation", t);
        var i = e.prototype;
        return (
          (i._setUp = function (t, e) {
            (this._labels = null),
              (this._animationNewFrames = null),
              (this._targetDic = t),
              (this._animationData = e),
              (this.interval = 1e3 / e.frameRate),
              e.parsed
                ? ((this._count = e.count),
                  (this._labels = e.labels),
                  (this._animationNewFrames = e.animationNewFrames))
                : ((this._animationNewFrames = []), this._calculateDatas()),
              (e.parsed = !0),
              (e.labels = this._labels),
              (e.count = this._count),
              (e.animationNewFrames = this._animationNewFrames);
          }),
          (i.clear = function () {
            t.prototype.clear.call(this),
              (this._targetDic = null),
              (this._animationData = null);
          }),
          (i._displayToIndex = function (t) {
            if (this._animationData) {
              t < 0 && (t = 0), t > this._count && (t = this._count);
              var e = this._animationData.nodes,
                i = 0,
                n = e.length;
              for (i = 0; i < n; i++) this._displayNodeToFrame(e[i], t);
            }
          }),
          (i._displayNodeToFrame = function (t, e, i) {
            i || (i = this._targetDic);
            var n = i[t.target];
            if (n) {
              var s,
                r,
                a,
                o = t.frames,
                h = t.keys,
                l = 0,
                c = h.length;
              for (l = 0; l < c; l++)
                (a = (r = o[(s = h[l])]).length > e ? r[e] : r[r.length - 1]),
                  (n[s] = a);
            }
          }),
          (i._calculateDatas = function () {
            if (this._animationData) {
              var t,
                e = this._animationData.nodes,
                i = 0,
                n = e.length;
              for (this._count = 0, i = 0; i < n; i++)
                (t = e[i]), this._calculateNodeKeyFrames(t);
              this._count += 1;
            }
          }),
          (i._calculateNodeKeyFrames = function (t) {
            var i,
              n,
              s = t.keyframes,
              r = t.target;
            t.frames || (t.frames = {}),
              t.keys ? (t.keys.length = 0) : (t.keys = []),
              t.initValues || (t.initValues = {});
            for (i in s)
              (n = s[i]),
                t.frames[i] || (t.frames[i] = []),
                this._targetDic &&
                  this._targetDic[r] &&
                  (t.initValues[i] = this._targetDic[r][i]),
                n.sort(e._sortIndexFun),
                t.keys.push(i),
                this._calculateNodePropFrames(n, t.frames[i], i, r);
          }),
          (i.resetToInitState = function () {
            if (this._targetDic && this._animationData) {
              var t,
                e,
                i = this._animationData.nodes,
                n = 0,
                s = i.length;
              for (n = 0; n < s; n++)
                if (((t = i[n]), (e = t.initValues))) {
                  var r = this._targetDic[t.target];
                  if (r) {
                    var a;
                    for (a in e) r[a] = e[a];
                  }
                }
            }
          }),
          (i._calculateNodePropFrames = function (t, e, i, n) {
            var s = 0,
              r = t.length - 1;
            for (e.length = t[r].index + 1, s = 0; s < r; s++)
              this._dealKeyFrame(t[s]),
                this._calculateFrameValues(t[s], t[s + 1], e);
            0 == r &&
              ((e[0] = t[0].value),
              this._animationNewFrames &&
                (this._animationNewFrames[t[0].index] = !0)),
              this._dealKeyFrame(t[s]);
          }),
          (i._dealKeyFrame = function (t) {
            t.label && "" != t.label && this.addLabel(t.label, t.index);
          }),
          (i._calculateFrameValues = function (t, e, i) {
            var n,
              s = 0,
              r = t.index,
              a = e.index,
              o = t.value,
              h = e.value - t.value,
              l = a - r;
            if ((a > this._count && (this._count = a), t.tween))
              for (
                null == (n = Ease[t.tweenMethod]) && (n = Ease.linearNone),
                  s = r;
                s < a;
                s++
              )
                (i[s] = n(s - r, o, h, l)),
                  this._animationNewFrames &&
                    (this._animationNewFrames[s] = !0);
            else for (s = r; s < a; s++) i[s] = o;
            this._animationNewFrames &&
              ((this._animationNewFrames[t.index] = !0),
              (this._animationNewFrames[e.index] = !0)),
              (i[e.index] = e.value);
          }),
          (e._sortIndexFun = null),
          e
        );
      })(AnimationPlayerBase),
      Input = (function (t) {
        function e() {
          (this._focus = !1),
            (this._multiline = !1),
            (this._editable = !0),
            (this._restrictPattern = null),
            (this._type = "text"),
            (this._prompt = ""),
            (this._promptColor = "#A9A9A9"),
            (this._originColor = "#000000"),
            (this._content = ""),
            e.__super.call(this),
            (this._maxChars = 1e5),
            (this._width = 100),
            (this._height = 20),
            (this.multiline = !1),
            (this.overflow = Text.SCROLL),
            this.on("mousedown", this, this._onMouseDown),
            this.on("undisplay", this, this._onUnDisplay);
        }
        __class(e, "laya.display.Input", t);
        var i = e.prototype;
        return (
          (i.setSelection = function (t, e) {
            (this.focus = !0),
              (laya.display.Input.inputElement.selectionStart = t),
              (laya.display.Input.inputElement.selectionEnd = e);
          }),
          (i._onUnDisplay = function (t) {
            this.focus = !1;
          }),
          (i._onMouseDown = function (t) {
            this.focus = !0;
          }),
          (i._syncInputTransform = function () {
            var t = this.nativeInput,
              i = Utils.getTransformRelativeToWindow(
                this,
                this.padding[3],
                this.padding[0]
              ),
              n = this._width - this.padding[1] - this.padding[3],
              s = this._height - this.padding[0] - this.padding[2];
            Render.isConchApp
              ? (t.setScale(i.scaleX, i.scaleY),
                t.setSize(n, s),
                t.setPos(i.x, i.y))
              : ((e.inputContainer.style.transform =
                  e.inputContainer.style.webkitTransform =
                    "scale(" +
                    i.scaleX +
                    "," +
                    i.scaleY +
                    ") rotate(" +
                    Laya.stage.canvasDegree +
                    "deg)"),
                (t.style.width = n + "px"),
                (t.style.height = s + "px"),
                (e.inputContainer.style.left = i.x + "px"),
                (e.inputContainer.style.top = i.y + "px"));
          }),
          (i.select = function () {
            this.nativeInput.select();
          }),
          (i._setInputMethod = function () {
            e.input.parentElement && e.inputContainer.removeChild(e.input),
              e.area.parentElement && e.inputContainer.removeChild(e.area),
              (e.inputElement = this._multiline ? e.area : e.input),
              e.inputContainer.appendChild(e.inputElement),
              Text.RightToLeft && (e.inputElement.style.direction = "rtl");
          }),
          (i._focusIn = function () {
            laya.display.Input.isInputting = !0;
            var t = this.nativeInput;
            this._focus = !0;
            var e = t.style;
            (e.whiteSpace = this.wordWrap ? "pre-wrap" : "nowrap"),
              this._setPromptColor(),
              (t.readOnly = !this._editable),
              Render.isConchApp &&
                (t.setType(this._type), t.setForbidEdit(!this._editable)),
              (t.maxLength = this._maxChars);
            this.padding;
            if (
              ((t.type = this._type),
              (t.value = this._content),
              (t.placeholder = this._prompt),
              Laya.stage.off("keydown", this, this._onKeyDown),
              Laya.stage.on("keydown", this, this._onKeyDown),
              (Laya.stage.focus = this),
              this.event("focus"),
              Browser.onPC && t.focus(),
              !Browser.onMiniGame)
            ) {
              this._text;
              this._text = null;
            }
            this.typeset(),
              t.setColor(this._originColor),
              t.setFontSize(this.fontSize),
              t.setFontFace(
                Browser.onIPhone
                  ? Text._fontFamilyMap[this.font] || this.font
                  : this.font
              ),
              Render.isConchApp &&
                t.setMultiAble &&
                t.setMultiAble(this._multiline),
              (e.lineHeight = this.leading + this.fontSize + "px"),
              (e.fontStyle = this.italic ? "italic" : "normal"),
              (e.fontWeight = this.bold ? "bold" : "normal"),
              (e.textAlign = this.align),
              (e.padding = "0 0"),
              this._syncInputTransform(),
              !Render.isConchApp &&
                Browser.onPC &&
                Laya.timer.frameLoop(1, this, this._syncInputTransform);
          }),
          (i._setPromptColor = function () {
            (e.promptStyleDOM = Browser.getElementById("promptStyle")) ||
              ((e.promptStyleDOM = Browser.createElement("style")).setAttribute(
                "id",
                "promptStyle"
              ),
              Browser.document.head.appendChild(e.promptStyleDOM)),
              (e.promptStyleDOM.innerText =
                "input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {color:" +
                this._promptColor +
                "}input:-moz-placeholder, textarea:-moz-placeholder {color:" +
                this._promptColor +
                "}input::-moz-placeholder, textarea::-moz-placeholder {color:" +
                this._promptColor +
                "}input:-ms-input-placeholder, textarea:-ms-input-placeholder {color:" +
                this._promptColor +
                "}");
          }),
          (i._focusOut = function () {
            (laya.display.Input.isInputting = !1),
              (this._focus = !1),
              (this._text = null),
              (this._content = this.nativeInput.value),
              this._content
                ? (Laya.superSet(Text, this, "text", this._content),
                  Laya.superSet(Text, this, "color", this._originColor))
                : (Laya.superSet(Text, this, "text", this._prompt),
                  Laya.superSet(Text, this, "color", this._promptColor)),
              Laya.stage.off("keydown", this, this._onKeyDown),
              (Laya.stage.focus = null),
              this.event("blur"),
              Render.isConchApp && this.nativeInput.blur(),
              Browser.onPC && Laya.timer.clear(this, this._syncInputTransform);
          }),
          (i._onKeyDown = function (t) {
            13 === t.keyCode &&
              (Browser.onMobile && !this._multiline && (this.focus = !1),
              this.event("enter"));
          }),
          (i.changeText = function (e) {
            (this._content = e),
              this._focus
                ? ((this.nativeInput.value = e || ""), this.event("change"))
                : t.prototype.changeText.call(this, e);
          }),
          __getset(0, i, "color", t.prototype._$get_color, function (t) {
            this._focus && this.nativeInput.setColor(t),
              Laya.superSet(
                Text,
                this,
                "color",
                this._content ? t : this._promptColor
              ),
              (this._originColor = t);
          }),
          __getset(
            0,
            i,
            "inputElementYAdjuster",
            function () {
              return (
                console.warn(
                  "deprecated: 由于即使设置了该值，在各平台和浏览器之间也不一定一致，inputElementYAdjuster已弃用。"
                ),
                0
              );
            },
            function (t) {
              console.warn(
                "deprecated: 由于即使设置了该值，在各平台和浏览器之间也不一定一致，inputElementYAdjuster已弃用。"
              );
            }
          ),
          __getset(
            0,
            i,
            "multiline",
            function () {
              return this._multiline;
            },
            function (t) {
              (this._multiline = t), (this.valign = t ? "top" : "middle");
            }
          ),
          __getset(
            0,
            i,
            "maxChars",
            function () {
              return this._maxChars;
            },
            function (t) {
              t <= 0 && (t = 1e5), (this._maxChars = t);
            }
          ),
          __getset(
            0,
            i,
            "text",
            function () {
              return this._focus ? this.nativeInput.value : this._content || "";
            },
            function (t) {
              Laya.superSet(Text, this, "color", this._originColor),
                (t += ""),
                this._focus
                  ? ((this.nativeInput.value = t || ""), this.event("change"))
                  : (this._multiline || (t = t.replace(/\r?\n/g, "")),
                    (this._content = t),
                    t
                      ? Laya.superSet(Text, this, "text", t)
                      : (Laya.superSet(Text, this, "text", this._prompt),
                        Laya.superSet(Text, this, "color", this.promptColor)));
            }
          ),
          __getset(0, i, "nativeInput", function () {
            return this._multiline ? e.area : e.input;
          }),
          __getset(
            0,
            i,
            "prompt",
            function () {
              return this._prompt;
            },
            function (t) {
              !this._text &&
                t &&
                Laya.superSet(Text, this, "color", this._promptColor),
                (this.promptColor = this._promptColor),
                this._text
                  ? Laya.superSet(
                      Text,
                      this,
                      "text",
                      this._text == this._prompt ? t : this._text
                    )
                  : Laya.superSet(Text, this, "text", t),
                (this._prompt =
                  Text.langPacks && Text.langPacks[t] ? Text.langPacks[t] : t);
            }
          ),
          __getset(
            0,
            i,
            "focus",
            function () {
              return this._focus;
            },
            function (t) {
              var i = this.nativeInput;
              this._focus !== t &&
                (t
                  ? (i.target ? i.target._focusOut() : this._setInputMethod(),
                    (i.target = this),
                    this._focusIn())
                  : ((i.target = null),
                    this._focusOut(),
                    (Browser.document.body.scrollTop = 0),
                    i.blur(),
                    Render.isConchApp
                      ? i.setPos(-1e4, -1e4)
                      : e.inputContainer.contains(i) &&
                        e.inputContainer.removeChild(i)));
            }
          ),
          __getset(
            0,
            i,
            "restrict",
            function () {
              return this._restrictPattern ? this._restrictPattern.source : "";
            },
            function (t) {
              t
                ? ((t = "[^" + t + "]").indexOf("^^") > -1 &&
                    (t = t.replace("^^", "")),
                  (this._restrictPattern = new RegExp(t, "g")))
                : (this._restrictPattern = null);
            }
          ),
          __getset(
            0,
            i,
            "editable",
            function () {
              return this._editable;
            },
            function (t) {
              (this._editable = t),
                Render.isConchApp && e.input.setForbidEdit(!t);
            }
          ),
          __getset(
            0,
            i,
            "promptColor",
            function () {
              return this._promptColor;
            },
            function (t) {
              (this._promptColor = t),
                this._content || Laya.superSet(Text, this, "color", t);
            }
          ),
          __getset(
            0,
            i,
            "type",
            function () {
              return this._type;
            },
            function (t) {
              (this._getCSSStyle().password = "password" == t),
                (this._type = t),
                Render.isConchApp && this.nativeInput.setType(t);
            }
          ),
          __getset(
            0,
            i,
            "inputElementXAdjuster",
            function () {
              return (
                console.warn(
                  "deprecated: 由于即使设置了该值，在各平台和浏览器之间也不一定一致，inputElementXAdjuster已弃用。"
                ),
                0
              );
            },
            function (t) {
              console.warn(
                "deprecated: 由于即使设置了该值，在各平台和浏览器之间也不一定一致，inputElementXAdjuster已弃用。"
              );
            }
          ),
          __getset(
            0,
            i,
            "asPassword",
            function () {
              return this._getCSSStyle().password;
            },
            function (t) {
              (this._getCSSStyle().password = t),
                (this._type = "password"),
                console.warn(
                  'deprecated: 使用type="password"替代设置asPassword, asPassword将在下次重大更新时删去'
                ),
                (this.isChanged = !0);
            }
          ),
          (e.__init__ = function () {
            e._createInputElement(),
              Browser.onMobile &&
                Render.canvas.addEventListener(
                  e.IOS_IFRAME
                    ? Browser.onMiniGame
                      ? "touchend"
                      : "click"
                    : "touchend",
                  e._popupInputMethod
                );
          }),
          (e._popupInputMethod = function (t) {
            if (laya.display.Input.isInputting) {
              laya.display.Input.inputElement.focus();
            }
          }),
          (e._createInputElement = function () {
            e._initInput((e.area = Browser.createElement("textarea"))),
              e._initInput((e.input = Browser.createElement("input"))),
              ((e.inputContainer =
                Browser.createElement("div")).style.position = "absolute"),
              (e.inputContainer.style.zIndex = 1e5),
              Browser.container.appendChild(e.inputContainer),
              (e.inputContainer.setPos = function (t, i) {
                (e.inputContainer.style.left = t + "px"),
                  (e.inputContainer.style.top = i + "px");
              });
          }),
          (e._initInput = function (t) {
            var i = t.style;
            (i.cssText =
              "position:absolute;overflow:hidden;resize:none;transform-origin:0 0;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-o-transform-origin:0 0;"),
              (i.resize = "none"),
              (i.backgroundColor = "transparent"),
              (i.border = "none"),
              (i.outline = "none"),
              (i.zIndex = 1),
              t.addEventListener("input", e._processInputting),
              t.addEventListener("mousemove", e._stopEvent),
              t.addEventListener("mousedown", e._stopEvent),
              t.addEventListener("touchmove", e._stopEvent),
              (t.setFontFace = function (e) {
                t.style.fontFamily = e;
              }),
              Render.isConchApp ||
                ((t.setColor = function (e) {
                  t.style.color = e;
                }),
                (t.setFontSize = function (e) {
                  t.style.fontSize = e + "px";
                }));
          }),
          (e._processInputting = function (t) {
            var e = laya.display.Input.inputElement.target;
            if (e) {
              var i = laya.display.Input.inputElement.value;
              e._restrictPattern &&
                ((i = i.replace(/\u2006|\x27/g, "")),
                e._restrictPattern.test(i) &&
                  ((i = i.replace(e._restrictPattern, "")),
                  (laya.display.Input.inputElement.value = i))),
                (e._text = i),
                e.event("input");
            }
          }),
          (e._stopEvent = function (t) {
            "touchmove" == t.type && t.preventDefault(),
              t.stopPropagation && t.stopPropagation();
          }),
          (e.TYPE_TEXT = "text"),
          (e.TYPE_PASSWORD = "password"),
          (e.TYPE_EMAIL = "email"),
          (e.TYPE_URL = "url"),
          (e.TYPE_NUMBER = "number"),
          (e.TYPE_RANGE = "range"),
          (e.TYPE_DATE = "date"),
          (e.TYPE_MONTH = "month"),
          (e.TYPE_WEEK = "week"),
          (e.TYPE_TIME = "time"),
          (e.TYPE_DATE_TIME = "datetime"),
          (e.TYPE_DATE_TIME_LOCAL = "datetime-local"),
          (e.TYPE_SEARCH = "search"),
          (e.input = null),
          (e.area = null),
          (e.inputElement = null),
          (e.inputContainer = null),
          (e.confirmButton = null),
          (e.promptStyleDOM = null),
          (e.inputHeight = 45),
          (e.isInputting = !1),
          (e.stageMatrix = null),
          __static(e, [
            "IOS_IFRAME",
            function () {
              return (this.IOS_IFRAME =
                Browser.onIOS && Browser.window.top != Browser.window.self);
            },
          ]),
          e
        );
      })(Text),
      HTMLImage = (function (t) {
        function e(t, i) {
          (this._recreateLock = !1),
            (this._needReleaseAgain = !1),
            (this._enableMerageInAtlas = !0),
            e.__super.call(this),
            this._init_(t, i);
        }
        __class(e, "laya.resource.HTMLImage", FileBitmap);
        var i = e.prototype;
        return (
          (i._init_ = function (t, e) {
            (this._src = t),
              (this._source = new Browser.window.Image()),
              e &&
                (e.onload && (this.onload = e.onload),
                e.onerror && (this.onerror = e.onerror),
                e.onCreate && e.onCreate(this)),
              0 != t.indexOf("data:image") && (this._source.crossOrigin = ""),
              t && (this._source.src = t);
          }),
          (i.recreateResource = function () {
            var t = this;
            if ("" === this._src) throw new Error("src no null！");
            if (((this._needReleaseAgain = !1), this._source)) {
              if (this._recreateLock) return;
              (this.memorySize = this._w * this._h * 4),
                (this._recreateLock = !1),
                this.completeCreate();
            } else {
              this._recreateLock = !0;
              var e = this;
              (this._source = new Browser.window.Image()),
                (this._source.crossOrigin = ""),
                (this._source.onload = function () {
                  if (e._needReleaseAgain)
                    return (
                      (e._needReleaseAgain = !1),
                      (e._source.onload = null),
                      void (e._source = null)
                    );
                  (e._source.onload = null),
                    (e.memorySize = t._w * t._h * 4),
                    (e._recreateLock = !1),
                    e.completeCreate();
                }),
                (this._source.src = this._src);
            }
          }),
          (i.disposeResource = function () {
            this._recreateLock && (this._needReleaseAgain = !0),
              this._source && ((this._source = null), (this.memorySize = 0));
          }),
          (i.onresize = function () {
            (this._w = this._source.width), (this._h = this._source.height);
          }),
          __getset(0, i, "onload", null, function (t) {
            var e = this;
            (this._onload = t),
              this._source &&
                (this._source.onload =
                  null != this._onload
                    ? function () {
                        e.onresize(), e._onload();
                      }
                    : null);
          }),
          __getset(0, i, "onerror", null, function (t) {
            var e = this;
            (this._onerror = t),
              this._source &&
                (this._source.onerror =
                  null != this._onerror
                    ? function () {
                        e._onerror();
                      }
                    : null);
          }),
          __getset(
            0,
            i,
            "enableMerageInAtlas",
            function () {
              return this._enableMerageInAtlas;
            },
            function (t) {
              (this._enableMerageInAtlas = t),
                Render.isConchApp &&
                  this._source &&
                  (this._source.enableMerageInAtlas = t);
            }
          ),
          (e.create = function (t, i) {
            return new e(t, i);
          }),
          e
        );
      })(),
      EffectAnimation = (function (t) {
        function e() {
          (this._target = null),
            (this._playEvents = null),
            (this._initData = {}),
            (this._aniKeys = null),
            (this._effectClass = null),
            e.__super.call(this);
        }
        __class(e, "laya.display.EffectAnimation", t);
        var i = e.prototype;
        return (
          (i._onOtherBegin = function (t) {
            t != this && this.stop();
          }),
          (i.addEvent = function () {
            this._target &&
              this._playEvents &&
              (this._setControlNode(this._target),
              this._target.on(this._playEvents, this, this._onPlayAction));
          }),
          (i._onPlayAction = function () {
            this.play(0, !1);
          }),
          (i.play = function (t, e, i, n) {
            void 0 === t && (t = 0),
              void 0 === e && (e = !0),
              void 0 === i && (i = ""),
              void 0 === n && (n = !0),
              this._target &&
                (this._target.event("effectanimationbegin", [this]),
                this._recordInitData(),
                laya.display.AnimationPlayerBase.prototype.play.call(
                  this,
                  t,
                  e,
                  i,
                  n
                ));
          }),
          (i._recordInitData = function () {
            if (this._aniKeys) {
              var t = 0,
                e = 0;
              e = this._aniKeys.length;
              var i;
              for (t = 0; t < e; t++)
                (i = this._aniKeys[t]), (this._initData[i] = this._target[i]);
            }
          }),
          (i._displayToIndex = function (t) {
            if (this._animationData) {
              t < 0 && (t = 0), t > this._count && (t = this._count);
              var e = this._animationData.nodes,
                i = 0,
                n = e.length;
              for (n = n > 1 ? 1 : n, i = 0; i < n; i++)
                this._displayNodeToFrame(e[i], t);
            }
          }),
          (i._displayNodeToFrame = function (t, e, i) {
            if (this._target) {
              var n;
              n = this._target;
              var s,
                r,
                a,
                o,
                h = t.frames,
                l = t.keys,
                c = 0,
                u = l.length;
              o = t.secondFrames;
              var _,
                d,
                f,
                p,
                g = 0;
              for (c = 0; c < u; c++)
                (r = h[(s = l[c])]),
                  -1 == (g = o[s])
                    ? (a = this._initData[s])
                    : e < g
                    ? (f = (d = t.keyframes[s])[0]).tween
                      ? (null == (_ = Ease[f.tweenMethod]) &&
                          (_ = Ease.linearNone),
                        (p = d[1]),
                        (a = _(
                          e,
                          this._initData[s],
                          p.value - this._initData[s],
                          p.index
                        )))
                      : (a = this._initData[s])
                    : (a = r.length > e ? r[e] : r[r.length - 1]),
                  (n[s] = a);
            }
          }),
          (i._calculateNodeKeyFrames = function (e) {
            t.prototype._calculateNodeKeyFrames.call(this, e);
            var i,
              n,
              s,
              r = e.keyframes;
            e.target;
            (s = {}), (e.secondFrames = s);
            for (i in r)
              (n = r[i]).length <= 1 ? (s[i] = -1) : (s[i] = n[1].index);
          }),
          __getset(
            0,
            i,
            "target",
            function () {
              return this._target;
            },
            function (t) {
              this._target &&
                this._target.off(
                  "effectanimationbegin",
                  this,
                  this._onOtherBegin
                ),
                (this._target = t),
                this._target &&
                  this._target.on(
                    "effectanimationbegin",
                    this,
                    this._onOtherBegin
                  ),
                this.addEvent();
            }
          ),
          __getset(0, i, "playEvent", null, function (t) {
            (this._playEvents = t), t && this.addEvent();
          }),
          __getset(0, i, "effectData", null, function (t) {
            if (t) {
              var e;
              (e = t.animations) &&
                e[0] &&
                (this._setUp({}, e[0]),
                e[0].nodes &&
                  e[0].nodes[0] &&
                  (this._aniKeys = e[0].nodes[0].keys));
            }
          }),
          __getset(0, i, "effectClass", null, function (t) {
            if (
              ((this._effectClass = ClassUtils.getClass(t)), this._effectClass)
            ) {
              var e;
              if ((e = this._effectClass.uiView)) {
                var i;
                (i = e.animations) &&
                  i[0] &&
                  (this._setUp({}, i[0]),
                  i[0].nodes &&
                    i[0].nodes[0] &&
                    (this._aniKeys = i[0].nodes[0].keys));
              }
            }
          }),
          (e.EffectAnimationBegin = "effectanimationbegin"),
          e
        );
      })(FrameAnimation),
      GraphicAnimation = (function (t) {
        function e() {
          (this.animationList = null),
            (this.animationDic = null),
            (this._nodeList = null),
            (this._nodeDefaultProps = null),
            (this._gList = null),
            (this._nodeIDAniDic = {}),
            (this._rootNode = null),
            (this._nodeGDic = null),
            e.__super.call(this);
        }
        var i;
        __class(e, "laya.utils.GraphicAnimation", t);
        var n = e.prototype;
        return (
          (n._parseNodeList = function (t) {
            this._nodeList || (this._nodeList = []),
              (this._nodeDefaultProps[t.compId] = t.props),
              t.compId && this._nodeList.push(t.compId);
            var e = t.child;
            if (e) {
              var i = 0,
                n = e.length;
              for (i = 0; i < n; i++) this._parseNodeList(e[i]);
            }
          }),
          (n._calGraphicData = function (t) {
            if (
              (this._setUp(null, t),
              this._createGraphicData(),
              this._nodeIDAniDic)
            ) {
              var e;
              for (e in this._nodeIDAniDic) this._nodeIDAniDic[e] = null;
            }
          }),
          (n._createGraphicData = function () {
            var t = [],
              e = 0,
              i = this.count,
              n = this._animationNewFrames;
            n || (n = []);
            var s;
            for (e = 0; e < i; e++)
              (!n[e] && s) || (s = this._createFrameGraphic(e)), t.push(s);
            this._gList = t;
          }),
          (n._createFrameGraphic = function (t) {
            var i = RunDriver.createGraphics();
            return (
              e._rootMatrix || (e._rootMatrix = new Matrix()),
              this._updateNodeGraphic(this._rootNode, t, e._rootMatrix, i),
              i
            );
          }),
          (n._updateNodeGraphic = function (t, e, i, n, s) {
            void 0 === s && (s = 1);
            var r,
              a =
                (r = this._nodeGDic[t.compId] =
                  this._getNodeGraphicData(
                    t.compId,
                    e,
                    this._nodeGDic[t.compId]
                  )).alpha * s;
            if (!(a < 0.01)) {
              r.resultTransform || (r.resultTransform = Matrix.create());
              var o;
              (o = r.resultTransform), Matrix.mul(r.transform, i, o);
              var h;
              r.skin &&
                (h = this._getTextureByUrl(r.skin)) &&
                (o._checkTransform()
                  ? (n.drawTexture(h, 0, 0, r.width, r.height, o, a),
                    (r.resultTransform = null))
                  : n.drawTexture(h, o.tx, o.ty, r.width, r.height, null, a));
              var l;
              if ((l = t.child)) {
                var c = 0,
                  u = 0;
                for (u = l.length, c = 0; c < u; c++)
                  this._updateNodeGraphic(l[c], e, o, n, a);
              }
            }
          }),
          (n._updateNoChilds = function (t, e) {
            if (t.skin) {
              var i = this._getTextureByUrl(t.skin);
              if (i) {
                var n = t.transform;
                n._checkTransform();
                !n.bTransform
                  ? e.drawTexture(
                      i,
                      n.tx,
                      n.ty,
                      t.width,
                      t.height,
                      null,
                      t.alpha
                    )
                  : e.drawTexture(
                      i,
                      0,
                      0,
                      t.width,
                      t.height,
                      n.clone(),
                      t.alpha
                    );
              }
            }
          }),
          (n._updateNodeGraphic2 = function (t, e, i) {
            var n;
            if (
              ((n = this._nodeGDic[t.compId] =
                this._getNodeGraphicData(
                  t.compId,
                  e,
                  this._nodeGDic[t.compId]
                )),
              t.child)
            ) {
              var s = n.transform;
              s._checkTransform();
              var r = !1,
                a = !1;
              a = (r = !s.bTransform) && (0 != s.tx || 0 != s.ty);
              var o = !1;
              (o = s.bTransform || 1 != n.alpha) && i.save(),
                1 != n.alpha && i.alpha(n.alpha),
                r ? a && i.translate(s.tx, s.ty) : i.transform(s.clone());
              var h;
              h = t.child;
              var l;
              if (
                (n.skin &&
                  (l = this._getTextureByUrl(n.skin)) &&
                  i.drawTexture(l, 0, 0, n.width, n.height),
                h)
              ) {
                var c = 0,
                  u = 0;
                for (u = h.length, c = 0; c < u; c++)
                  this._updateNodeGraphic2(h[c], e, i);
              }
              o
                ? i.restore()
                : r
                ? a && i.translate(-s.tx, -s.ty)
                : i.transform(s.clone().invert());
            } else this._updateNoChilds(n, i);
          }),
          (n._calculateNodeKeyFrames = function (e) {
            t.prototype._calculateNodeKeyFrames.call(this, e),
              (this._nodeIDAniDic[e.target] = e);
          }),
          (n.getNodeDataByID = function (t) {
            return this._nodeIDAniDic[t];
          }),
          (n._getParams = function (t, i, n, s) {
            var r = e._temParam;
            r.length = i.length;
            var a = 0,
              o = i.length;
            for (a = 0; a < o; a++)
              r[a] = this._getObjVar(t, i[a][0], n, i[a][1], s);
            return r;
          }),
          (n._getObjVar = function (t, e, i, n, s) {
            if (t.hasOwnProperty(e)) {
              var r = t[e];
              return i >= r.length && (i = r.length - 1), t[e][i];
            }
            return s.hasOwnProperty(e) ? s[e] : n;
          }),
          (n._getNodeGraphicData = function (t, n, s) {
            s || (s = i.create()),
              s.transform
                ? s.transform.identity()
                : (s.transform = Matrix.create());
            var r = this.getNodeDataByID(t);
            if (!r) return s;
            var a = r.frames,
              o = this._getParams(
                a,
                e._drawTextureCmd,
                n,
                this._nodeDefaultProps[t]
              ),
              h = o[0],
              l = NaN,
              c = NaN,
              u = o[5],
              _ = o[6],
              d = o[13],
              f = o[14],
              p = o[7],
              g = o[8],
              m = o[9],
              v = o[11],
              y = o[12];
            (l = o[3]),
              (c = o[4]),
              (0 != l && 0 != c) || (h = null),
              -1 == l && (l = 0),
              -1 == c && (c = 0);
            var w;
            (s.skin = h),
              (s.width = l),
              (s.height = c),
              h &&
                ((w = this._getTextureByUrl(h))
                  ? (l || (l = w.sourceWidth), c || (c = w.sourceHeight))
                  : console.warn("lost skin:", h, ",you may load pics first")),
              (s.alpha = o[10]);
            var x;
            (x = s.transform),
              0 != d && (u = d * l),
              0 != f && (_ = f * c),
              (0 == u && 0 == _) || x.translate(-u, -_);
            var T = null;
            if (m || 1 !== p || 1 !== g || v || y) {
              (T = e._tempMt).identity(), (T.bTransform = !0);
              var b = 0.0174532922222222 * (m - v),
                C = 0.0174532922222222 * (m + y),
                M = Math.cos(C),
                S = Math.sin(C),
                L = Math.sin(b),
                R = Math.cos(b);
              (T.a = p * M),
                (T.b = p * S),
                (T.c = -g * L),
                (T.d = g * R),
                (T.tx = T.ty = 0);
            }
            return T && (x = Matrix.mul(x, T, x)), x.translate(o[1], o[2]), s;
          }),
          (n._getTextureByUrl = function (t) {
            return Loader.getRes(t);
          }),
          (n.setAniData = function (t, i) {
            if (t.animations) {
              (this._nodeDefaultProps = {}),
                (this._nodeGDic = {}),
                this._nodeList && (this._nodeList.length = 0),
                (this._rootNode = t),
                this._parseNodeList(t);
              var n,
                s = {},
                r = [],
                a = t.animations,
                o = 0,
                h = a.length;
              for (o = 0; o < h; o++)
                if (
                  ((n = a[o]), (this._labels = null), (!i || i == n.name) && n)
                ) {
                  try {
                    this._calGraphicData(n);
                  } catch (t) {
                    console.warn(
                      "parse animation fail:" +
                        n.name +
                        ",empty animation created"
                    ),
                      (this._gList = []);
                  }
                  var l = {};
                  (l.interval = 1e3 / n.frameRate),
                    (l.frames = this._gList),
                    (l.labels = this._labels),
                    (l.name = n.name),
                    r.push(l),
                    (s[n.name] = l);
                }
              (this.animationList = r), (this.animationDic = s);
            }
            e._temParam.length = 0;
          }),
          (n.parseByData = function (t) {
            var e, i;
            (e = t.nodeRoot),
              (i = t.aniO),
              delete t.nodeRoot,
              delete t.aniO,
              (this._nodeDefaultProps = {}),
              (this._nodeGDic = {}),
              this._nodeList && (this._nodeList.length = 0),
              (this._rootNode = e),
              this._parseNodeList(e),
              (this._labels = null);
            try {
              this._calGraphicData(i);
            } catch (t) {
              console.warn(
                "parse animation fail:" + i.name + ",empty animation created"
              ),
                (this._gList = []);
            }
            var n = t;
            return (
              (n.interval = 1e3 / i.frameRate),
              (n.frames = this._gList),
              (n.labels = this._labels),
              (n.name = i.name),
              n
            );
          }),
          (n.setUpAniData = function (t) {
            if (t.animations) {
              var e,
                i = {},
                n = [],
                s = t.animations,
                r = 0,
                a = s.length;
              for (r = 0; r < a; r++)
                if ((e = s[r])) {
                  var o = {};
                  (o.name = e.name),
                    (o.aniO = e),
                    (o.nodeRoot = t),
                    n.push(o),
                    (i[e.name] = o);
                }
              (this.animationList = n), (this.animationDic = i);
            }
          }),
          (n._clear = function () {
            if (
              ((this.animationList = null),
              (this.animationDic = null),
              (this._gList = null),
              this._nodeGDic)
            ) {
              var t, e;
              for (t in this._nodeGDic) (e = this._nodeGDic[t]) && e.recover();
            }
            this._nodeGDic = null;
          }),
          (e.parseAnimationByData = function (t) {
            e._I || (e._I = new e());
            var i;
            return (i = e._I.parseByData(t)), e._I._clear(), i;
          }),
          (e.parseAnimationData = function (t) {
            e._I || (e._I = new e()), e._I.setUpAniData(t);
            var i;
            return (
              (i = {}),
              (i.animationList = e._I.animationList),
              (i.animationDic = e._I.animationDic),
              e._I._clear(),
              i
            );
          }),
          (e._drawTextureCmd = [
            ["skin", null],
            ["x", 0],
            ["y", 0],
            ["width", -1],
            ["height", -1],
            ["pivotX", 0],
            ["pivotY", 0],
            ["scaleX", 1],
            ["scaleY", 1],
            ["rotation", 0],
            ["alpha", 1],
            ["skewX", 0],
            ["skewY", 0],
            ["anchorX", 0],
            ["anchorY", 0],
          ]),
          (e._temParam = []),
          (e._I = null),
          (e._rootMatrix = null),
          __static(e, [
            "_tempMt",
            function () {
              return (this._tempMt = new Matrix());
            },
          ]),
          (e.__init$ = function () {
            i = (function () {
              function t() {
                (this.skin = null),
                  (this.transform = null),
                  (this.resultTransform = null),
                  (this.width = NaN),
                  (this.height = NaN),
                  (this.alpha = 1);
              }
              __class(t, "");
              return (
                (t.prototype.recover = function () {
                  (this.skin = null),
                    (this.width = 0),
                    (this.height = 0),
                    (this.alpha = 1),
                    this.transform &&
                      (this.transform.destroy(), (this.transform = null)),
                    this.resultTransform &&
                      (this.resultTransform.destroy(),
                      (this.resultTransform = null)),
                    Pool.recover("GraphicNode", this);
                }),
                (t.create = function () {
                  return Pool.getItemByClass("GraphicNode", t);
                }),
                t
              );
            })();
          }),
          e
        );
      })(FrameAnimation);
    Laya.__init([
      EventDispatcher,
      LoaderManager,
      Render,
      Browser,
      Timer,
      LocalStorage,
      TimeLine,
      GraphicAnimation,
    ]);
  })(window, document, Laya),
  (function (t, e, i) {
    i.un, i.uns, i.static;
    var n = i.class;
    i.getset, i.__newvec;
    new ((function () {
      function t() {}
      return n(t, "LayaMain"), t;
    })())();
  })(window, document, Laya),
  "function" == typeof define &&
    define.amd &&
    define("laya.core", ["require", "exports"], function (t, e) {
      "use strict";
      Object.defineProperty(e, "__esModule", { value: !0 });
      for (var i in Laya) {
        var n = Laya[i];
        n && n.__isclass && (e[i] = n);
      }
    });
